Ruby: How to post a file via HTTP as multipart/form-data?

Posted by kch on Stack Overflow See other posts from Stack Overflow or by kch
Published on 2008-10-08T18:31:41Z Indexed on 2010/05/09 7:48 UTC
Read the original article Hit count: 256

Filed under:
|
|

I want to do an HTTP POST that looks like an HMTL form posted from a browser. Specifically, post some text fields and a file field.

Posting text fields is straightforward, there's an example right there in the net/http rdocs, but I can't figure out how to post a file along with it.

Net::HTTP doesn't look like the best idea. curb is looking good.

© Stack Overflow or respective owner

Related posts about ruby

Related posts about http