ruby - How do I PUT a file with Typheous? -
I am trying to send a file through a What is the correct way to do this with Typheous? FWI is what I think was complete (but not necessarily at least) the question Answer: Allows curl files to be uploaded w / PUT; Greetings: While the url might look something like this: Typhoeus provides the same functionality, but the file body has been buried in Ethon docs along with the correct method of going url, params and them: HTTP PUT request.
curl allows this type of:
http://curl.haxx.se/docs/httpscripting.html#PUT
$ curl --upload-file filename url
http: //someurl/script.php? var = value & amp; anothervar = val & amp; ...
request = typhos :: request New (URL ,: method =>: put: params => params_hash,: body => File.open (filename) {| io | io.read}) < p> Use the request object to get the response, etc.
Comments
Post a Comment