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

This entry was posted in Ruby on Rails and tagged , , , . Bookmark the permalink.

Leave a Reply

Your email address will not be published. Required fields are marked *

*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>