GeezerVisonThe World Wide Web, restored to 800 pixels of glory. | ||||||||||||||
| Home|About|Gaming cabinet|Archives|How it works|Starter sites | ||||||||||||||
GeezerVison is showing developer.mozilla.org — POST request method - HTTP | MDN POST request method
|
| Request has body | Yes |
|---|---|
| Successful response has body | Yes |
| Safe | No |
| Idempotent | No |
| Cacheable | Only if freshness information is included |
| Allowed in HTML forms | Yes |
POST <request-target>["?"<query>] HTTP/1.1
<request-target>Identifies the target resource of the request when combined with the information provided in the Host header.
This is an absolute path (e.g., /path/to/file.html) in requests to an origin server, and an absolute URL in requests to proxies (e.g., http://www.example.com/path/to/file.html).
<query> OptionalAn optional query component preceded by a question-mark ?.
Often used to carry identifying information in the form of key=value pairs.
A form using application/x-www-form-urlencoded content encoding (the default) sends a request where the body contains the form data in key=value pairs, with each pair separated by an & symbol, as shown below:
POST /test HTTP/1.1
Host: example.com
Content-Type: application/x-www-form-urlencoded
Content-Length: 27
field1=value1&field2=value2
The multipart/form-data encoding is used when a form includes files or a lot of data.
This request body delineates each part of the form using a boundary string.
An example of a request in this format:
POST /test HTTP/1.1
Host: example.com
Content-Type: multipart/form-data;boundary="delimiter12345"
--delimiter12345
Content-Disposition: form-data; name="field1"
value1
--delimiter12345
Content-Disposition: form-data; name="field2"; filename="example.txt"
value2
--delimiter12345--
The Content-Disposition header indicates how the form data should be processed, specifying the field name and filename, if appropriate.
| Specification |
|---|
| HTTP Semantics # POST |
Content-Type headerContent-Disposition headerGET method