How are parameters sent in an HTTP POST request

De openkb
Aller à : Navigation, rechercher

Sommaire

Questions

In an HTTP GET request, parameters are sent as a query string  :

http://example.com/page     ?parameter=value&also=another     

In an HTTP POST request, the parameters are not sent along with the URI.

    Where are the values?      In the request header? In the request body? What does it look like?

Answers

The values are sent in the request body, in the format that the content type specifies.

Usually the content type is application/x-www-form-urlencoded, so the request body uses the same format as the query string:

parameter=value&also=another

When you use a file upload in the form, you use the multipart/form-data encoding instead, which has a different format. It s more complicated, but you usually don t need to care what it looks like, so I won t show an example, but it can be good to know that it exists.

Source

License : cc by-sa 3.0

http://stackoverflow.com/questions/14551194/how-are-parameters-sent-in-an-http-post-request

Related

Outils personnels
Espaces de noms

Variantes
Actions
Navigation
Outils