From: rvarghese@... (Roy Varghese) Date: 2003-09-04T05:03:36+09:00 Subject: How do I POST a multipart request? Hello I am writing a script to send a POST request to a webserver. The request consists of the following: POST /someurl/servlets/SomeServlet Host: myname User-Agent: Mozilla/5.0 (Macintosh; U; PPC Mac OS X Mach-O; en-US; rv:1.3b) Accept: text/xml,application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,video/x-mng,image/png,image/jpeg,image/gif;q=0.2,*/*;q=0.1 Accept-Encoding: none Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.7 Keep-Alive: 300 Connection: close Referer: http://someserver/servlets/servlet1 Cookie: USERID=test Content-Type: multipart/form-data; boundary=---------------------------1896019318556346621028960807 Content-Length: 1380 -----------------------------1896019318556346621028960807 Content-Disposition: form-data; name="name" Roy -----------------------------1896019318556346621028960807 Content-Disposition: form-data; name="age" 0 -----------------------------1896019318556346621028960807 Content-Disposition: form-data; name="address" 12 Street -----------------------------1896019318556346621028960807 How can I use Ruby to send this request? The Net::HTTP.post method takes only the POST path and a hash of the headers, whereas some of the content of the request I have to send, cannot be hashed. Thx Roy