Pages

HTTP Post to a remote server in Ruby

To every ruby developer’s surprise, the built-in Net::HTTP does not support Multipart natively. There are a couple of solutions: write multipart function by yourself, use a third part plugin such as curb or RestClient.

Be aware though. Curb can easily crash your rails if the parameter is not a String. For example, if you have an integer stored in the session, and you pass that to curb directly, then your ruby server will crash. It took me a couple of hours to figure that out…

See other posts

Leave a Reply

 

 

 

You can use these HTML tags

<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>