US/docs/Learn/Forms) and results in a change on the server. In this case, the
content type is selected by putting the adequate string in the [ ` enctype `
](/en-US/docs/Web/HTML/Element/form#enctype) attribute of the [ ` <form> `
](/en-US/docs/Web/HTML/Element/form) element or the [ ` formenctype ` ](/en-
US/docs/Web/HTML/Element/input#formenctype) attribute of the [ ` <input> `
](/en-US/docs/Web/HTML/Element/input) or [ ` <button> ` ](/en-
US/docs/Web/HTML/Element/button) elements:

  * ` application/x-www-form-urlencoded ` : the keys and values are encoded in key-value tuples separated by ` '&' ` , with a ` '=' ` between the key and the value. Non-alphanumeric characters in both keys and values are [ URL encoded ](https://en.wikipedia.org/wiki/URL_encoding) : this is the reason why this type is not suitable to use with binary data (use ` multipart/form-data ` instead) 
  * ` multipart/form-data ` : each value is sent as a block of data ("body part"), with a user agent-defined delimiter ("boundary") separating each part. The keys are given in the ` Content-Disposition ` header of each part. 
  * ` text/plain `

When the ` POST ` request is sent via a method other than an HTML form, such
as a [ ` fetch() ` ](/en-US/docs/Web/API/fetch) call, the body can take any
type. As described in the HTTP 1.1 specification, ` POST ` is designed to
allow a uniform method to cover the following functions:

  * Annotation of existing resources 
  * Posting a message to a bulletin board, newsgroup, mailing list, or similar group of articles; 
  * Adding a new user through a signup modal; 
  * Providing a block of data, such as the result of submitting a form, to a data-handling process; 
  * Extending a database through an append operation. 

Request has body  |  Yes   
---|---  
Successful response has body  |  Yes   
[ Safe ](/en-US/docs/Glossary/Safe/HTTP) |  No   
[ Idempotent ](/en-US/docs/Glossary/Idempotent) |  No   
[ Cacheable ](/en-US/docs/Glossary/Cacheable) |  Only if freshness information is included   
Allowed in [ HTML forms ](/en-US/docs/Learn/Forms) |  Yes   
  
##  Syntax

http

    
    
    POST /test
    

##  Example

A simple form using the default ` application/x-www-form-urlencoded ` content
type:

http

    
    
    POST /test HTTP/1.1
    Host: foo.example
    Content-Type: application/x-www-form-urlencoded
    Content-Length: 27
    
    field1=value1&field2=value2
    

A form using the ` multipart/form-data ` content type:

http

    
    
    POST /test HTTP/1.1
    Host: foo.example
    Content-Type: multipart/form-data;boundary="boundary"
    
    --boundary
    Content-Disposition: form-data; name="field1"
    
    value1
    --boundary
    Content-Disposition: form-data; name="field2"; filename="example.txt"
    
    value2
    --boundary--
    

##  Specifications

Specification  
---  
[ HTTP Semantics  
#  POST  ](https://www.rfc-editor.org/rfc/rfc9110#POST)  
  
##  Browser compatibility

BCD tables only load in the browser  with JavaScript enabled. Enable
JavaScript to view data.

##  See also

  * [ ` Content-Type ` ](/en-US/docs/Web/HTTP/Headers/Content-Type)
  * [ ` Content-Disposition ` ](/en-US/docs/Web/HTTP/Headers/Content-Disposition)
  * [ ` GET ` ](/en-US/docs/Web/HTTP/Methods/GET)

##  Help improve MDN

Was this page helpful to you?

Yes  No

[ Learn how to contribute
](https://github.com/mdn/content/blob/main/CONTRIBUTING.md "This will take you
to our contribution guidelines on GitHub.") .

This page was last modified on  Dec 16, 2023  by  [ MDN contributors ](/en-
US/docs/Web/HTTP/Methods/POST/contributors.txt) .

[ View this page on GitHub
](https://github.com/mdn/content/blob/main/files/en-
us/web/http/methods/post/index.md?plain=1 "Folder: en-us/web/http/methods/post
\(Opens in a new tab\)") â¢  [ Report a problem with this content
](https://github.com/mdn/content/issues/new?template=page-report.yml&mdn-
url=https%3A%2F%2Fdeveloper.mozilla.org%2Fen-
US%2Fdocs%2FWeb%2FHTTP%2FMethods%2FPOS