en

POST is a method of the HTTP protocol that sends data to a server: a filled-in form, a file or JSON. Unlike GET, the data is passed in the request body rather than in the URL, and it usually changes state on the server side.

How POST works

The browser builds a POST request when you submit a form or upload a file. The request body can be of any size and contain binary data, and the Content-Type header tells the server its format. Like any request, POST begins with looking up the IP address through DNS and establishing a connection — the whole path is described in the article How a browser works.

Characteristics of POST

The method has important distinctions that affect how a site behaves:

  • Not idempotent — resending it can create a duplicate record, which is why browsers ask you to confirm resubmitting a form.
  • Not cached — a response to POST is not saved by default, unlike GET.
  • Confidentiality — the data is hidden from the address bar, but only TLS encryption actually protects it.

POST is used wherever data needs to be sent to a server: signing in, payment, publishing content.

HTTP POST: sending data to a server
Learn more