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…