- Home
- API Design
- What Is The HTTP POST Request?

POST is an HTTP method used to send data to a server to create/update a resource. The HTTP POST method is used to create or add a resource on the server. Typically, the POST request adds a new resource to the server, while the PUT request replaces an existing resource on the server.
The type of the body of the request is indicated by the Content-Type header. application/x-www-form-urlencoded is the keys and values are encoded in key-value tuples separated by ‘&’, with a ‘=’ between the key and the value.
For example, the HTTP POST request method is used by browsers when submitting HTML form data to the server or when submitting data using jQuery/AJAX requests.
POST /test
In the POST method, the data sent to the server with POST is stored in the request body of the HTTP request. A simple form using the default application/x-www-form-urlencoded content type:
POST /test HTTP/1.1 Host: apitier.com Content-Type: application/x-www-form-urlencoded Content-Length: 27 field1=value1&field2=value2
POST /test HTTP/1.1 Host: apitier.com Content-Type: application/x-www-form-urlencoded Content-Length: 27 name=Sam&city=london
Above the example query string (name/city) is sent in the HTTP message body of a POST request.