HTTP headers | Allow

The HTTP Allow header is an Entity-type header that specifies the valid methods that are supported by a resource. It is used in response for a 405 Method not allowed. If this header is empty it means the resource does not allow any request methods.

Syntax:

Allow: <http-methods>

Directives: The HTTP Allow header accepts a single directive mentioned above and described below:



  • <http-methods>: This directive holds the list of HTTP request methods. If the requests are more than one then the request are separated by commas.

Examples:

  • When there is just one method. The POST method is used to submit an entity to the specified resource which often causes a change in state on the server.
    Allow: POST
  • When there are multiple methods. The PATCH method is used to apply partial modifications to a resource while the DELETE method deletes the specified resource.
    Allow: PATCH, DELETE

To check this Allow in action go to Inspect Element -> Network check the header for Allow like below.

Supported browsers: The browsers compatible with HTTP Allow header are listed below:

  • Google Chrome
  • Internet Explorer
  • Firefox
  • Safari
  • Opera


My Personal Notes arrow_drop_up

Check out this Author's contributed articles.

If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to contribute@geeksforgeeks.org. See your article appearing on the GeeksforGeeks main page and help other Geeks.

Please Improve this article if you find anything incorrect by clicking on the "Improve Article" button below.


Article Tags :

Be the First to upvote.


Please write to us at contribute@geeksforgeeks.org to report any issue with the above content.