Install Ruby Curb gem in windows XP

后端 未结 11 877
无人及你
无人及你 2020-12-15 12:29

I\'m trying to do file uploads with ruby 1.8 and it seems like there are no good out-of-the-box solutions. They all seem to need some 3rd party patch or fork of a project to

11条回答
  •  星月不相逢
    2020-12-15 12:37

    As I commented already, I did find a solution which was simply using the rest-client provided in the github gems.. gem install rest-client will get the job done. From there you can do a multipart post which can contain 1 or more files.. It has all the flexibility one could need in a rest-client. See the documentation here: http://rdoc.info/projects/archiloque/rest-client for examples on how to use it.

    The only thing I found that it didn't do correctly was parsing cookies. The cookies my company uses can have equal signs in the values and it doesn't parse them correctly. I had put in some hacks to get around the issue but eventually that came back to bite me.. So just the other day I started analyzing the code from Mechanize/WEBrick and was able to utilize the CookieJar from Mechanize to manage cookies from the rest-client.. Hopefully I can get the author of the rest-client to build this functionality into the rest-client so others won't have the same problems I had..

提交回复
热议问题