Building POST data manually

After spending quite a while trying to figure this out I’m posting it as a reminder in future

POST http://example.com/upload.php HTTP/1.1 
User-Agent: Photo Uploader (foobar/1.0.0) 
Content-Type: multipart/form-data; boundary=AaB03x 
Content-Length: xxxx 

--AaB03x 
Content-Disposition: form-data; name="foo" 
Content-Type: text/plain; charset=utf-8 

12345 
--AaB03x 
Content-Disposition: form-data; name="Filename" 
Content-Type: text/plain; charset=utf-8 

image1.jpg 
--AaB03x 
Content-Disposition: form-data; name="MimeType" 
Content-Type: text/plain; charset=utf-8 

image/jpeg 
--AaB03x 
Content-Disposition: form-data; name="ImageData";
filename="image1.jpg" 
Content-Type: image/jpeg 
Content-Transfer-Encoding: binary 

 
--AaB03x--

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>