Revision 1109373 of HTTP request methods

  • Revision slug: Web/HTTP/Methods
  • Revision title: HTTP request methods
  • Revision id: 1109373
  • Created:
  • Creator: mike-lang
  • Is current revision? No
  • Comment

Revision Content

{{HTTPSidebar}}

HTTP defines a set of request methods to indicate the desired action to be performed for a given resource. Although they can also be nouns, these requests methods are sometimes referred as HTTP verbs. Each of them implements a different semantic, but some common features are shared by a group of them: e.g. a request method can be {{glossary("safe")}}, {{glossary("idempotent")}}, or {{glossary("cacheable")}}.

GET
The GET method requests a representation of the specified resource. Requests using GET should only retrieve data.
HEAD
The HEAD method asks for a response identical to that of a GET request, but without the response body.
POST
The POST method is used to submit an entity to the specified resource, often causing a change in state or side effects on the server.  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;
  • 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.
 As an example, HTML Forms POST their content to their target resource.
PUT
 
DELETE
The DELETE method deletes the specified resource.
CONNECT
 
OPTIONS
 
TRACE
 
PATCH
 

Browser compatibility

{{Compat}}

See also

Revision Source

<p>{{HTTPSidebar}}</p>

<p>HTTP defines a set of <strong>request methods</strong> to indicate the desired action to be performed for a given resource. Although they can also be nouns, these requests methods are sometimes referred as <em>HTTP verbs</em>. Each of them implements a different semantic, but some common features are shared by a group of them: e.g. a request method can be {{glossary("safe")}}, {{glossary("idempotent")}}, or {{glossary("cacheable")}}.</p>

<dl>
 <dt><code><a href="/en-US/docs/Web/HTTP/Methods/GET">GET</a></code></dt>
 <dd>The <code>GET</code> method requests a representation of the specified resource. Requests using <code>GET</code> should only retrieve data.</dd>
 <dt><code><a href="/en-US/docs/Web/HTTP/Methods/HEAD">HEAD</a></code></dt>
 <dd>The <code>HEAD</code> method asks for a response identical to that of a <code>GET</code> request, but without the response body.</dd>
 <dt><code><a href="/en-US/docs/Web/HTTP/Methods/POST">POST</a></code></dt>
 <dd>The <code>POST</code> method is used to submit an entity to the specified resource, often causing a change in state or side effects on the server. &nbsp;As described in the <a href="https://www.w3.org/Protocols/rfc2616/rfc2616-sec9.html">HTTP 1.1 specification</a>:</dd>
 <dd>
 <blockquote>
 <dl>
  <dt>
  <p>POST is designed to allow a uniform method to cover the following functions:</p>

  <ul>
   <li>Annotation of existing resources</li>
   <li>Posting a message to a bulletin board, newsgroup, mailing list, or similar group of articles;</li>
   <li>Providing a block of data, such as the result of submitting a form, to a data-handling process;</li>
   <li>Extending a database through an append operation.</li>
  </ul>
  </dt>
 </dl>
 </blockquote>
 </dd>
 <dd>&nbsp;As an example,&nbsp;<a href="/en-US/docs/Web/Guide/HTML/Forms">HTML Forms</a>&nbsp;<code>POST</code> their content to their target resource.</dd>
 <dt><code><a href="/en-US/docs/Web/HTTP/Methods/PUT">PUT</a></code></dt>
 <dd>&nbsp;</dd>
 <dt><code><a href="/en-US/docs/Web/HTTP/Methods/DELETE">DELETE</a></code></dt>
 <dd>The <code>DELETE</code> method deletes the specified resource.</dd>
 <dt><code><a href="/en-US/docs/Web/HTTP/Methods/CONNECT">CONNECT</a></code></dt>
 <dd>&nbsp;</dd>
 <dt><code><a href="/en-US/docs/Web/HTTP/Methods/OPTIONS">OPTIONS</a></code></dt>
 <dd>&nbsp;</dd>
 <dt><code><a href="/en-US/docs/Web/HTTP/Methods/TRACE">TRACE</a></code></dt>
 <dd>&nbsp;</dd>
 <dt><code><a href="/en-US/docs/Web/HTTP/Methods/PATCH">PATCH</a></code></dt>
 <dd>&nbsp;</dd>
</dl>

<h2 id="Browser_compatibility">Browser compatibility</h2>

<p class="hidden">To contribute to this compatibility data, please write a pull request against this file: <a href="https://github.com/mdn/browser-compat-data/blob/master/http/methods.json">https://github.com/mdn/browser-compat-data/blob/master/http/methods.json</a>.</p>

<p>{{Compat}}</p>

<h2 id="See_also">See also</h2>

<ul>
 <li><a href="/en-US/docs/Web/HTTP/Headers">HTTP headers</a></li>
</ul>
Revert to this revision