Search code examples
httpwebformshttpwebrequesthttp-headersmime

What are the defaults, if any, for HTTP POST request headers when uploading a file?


What I mean is for example when you send a form that includes a file upload via POST, the POST request contains certain information like "Content-Disposition", "Content-Type", "Content-Transfer-Encoding", etc.

In the case of a file upload should "Content-Disposition" be "form-data" and "Content-Type" "application/octet-stream"? What about "Content-Transfer-Encoding"?

More specifically, what are the defaults when you use a web form to upload a file? I ask this because I'm trying to create a POST request identical to the ones a browser sends when uploading a file. Obviously when you submit a web form you don't really specify what these request headers are; the browser must automatically set them and I'm wondering what the defaults are so I can mimic them.


Solution

  • you can use firebug to see the headers and post parameters when you post a file form to the server.