ruby - How do I PUT a file with Typheous? -


I am trying to send a file through a HTTP PUT request. curl allows this type of:

  http://curl.haxx.se/docs/httpscripting.html#PUT   

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:

  $ curl --upload-file filename url   

While the url might look something like this:

  http: //someurl/script.php? var = value & amp; anothervar = val & amp; ...   

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:

  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

Popular posts from this blog

Verilog Error: output or inout port "Q" must be connected to a structural net expression -

jasper reports - How to center align barcode using jasperreports and barcode4j -

c# - ASP.NET MVC - Attaching an entity of type 'MODELNAME' failed because another entity of the same type already has the same primary key value -