Could anyone show me an example of what a client would send to upload data using http? So far I have tried sending this:
POST /post.php HTTP/1.1
Host: foo.bar
Content-Type: application/x-www-form-urlencoded
Content-Length: 14
data=something
which works great, but doesn't work for binary data, only text files. I have searched around and found http://www.ietf.org/rfc/rfc1867.txt which describes file uploading, but I can't get it to work. From one of the examples they show:
Content-type: multipart/form-data, boundary=AaB03x
--AaB03x
content-disposition: form-data; name="field1"
Joe Blow
--AaB03x
content-disposition: form-data; name="pics"; filename="file1.txt"
Content-Type: text/plain
... contents of file1.txt ...
--AaB03x--
but when I send this to my server, apache responds that it can't understand the request. I have also modified the last example adding the POST, and Hostname lines, but that didn't work. Anyone know the correct response i need to be sending?
thanks