Allow HTTP Header: Syntax, Directive, Examples

The Allow HTTP Header is a type of Entity header that specifies the valid methods that a resource supports. It is used in response to a 405 Method is not a permitted error. If the Allow HTTP Header value is missing, it indicates that the resource does not support any request methods. The HyperText Transfer Protocol (HTTP) 405 Method Not Allowed response status code indicates that the server is aware of the request method but that the requested resource does not support it. The server must include an Allow header field in response to a 405 status code. The field must include a list of the methods currently supported by the target resource. There is only one value for using the Allow HTTP Header. The value using the Allow HTTP Header is the http-method. An example of the Allow HTTP Header is written below.  

Allow: GET, POST, HEAD

The Allow HTTP Header Response Header is seen above. In the article, the Allow HTTP Header Syntax, Directives, and Uses examples will be processed. 

What is Allow HTTP Header?

An Allow HTTP Header is a type of entity header that indicates the valid methods that a resource supports. It is used to respond to a 405 method not permitted error. If the Allow HTTP Header value is omitted, it indicates that the resource does not support any request methods.

What is the Syntax of Allow HTTP Header?

The Allow HTTP Header uses only one value in its syntax. The syntax for using the Allow HTTP Header is written below. 

Allow: <http-methods>

What is the Directive on Allow HTTP Header?

The Allow HTTP Header can only contain one directive. The “<http-methods>” identifies the HTTP request methods. If there are multiple requests, they are separated by commas. An example directive for using the RTT HTTP Header is given below. 

Allow: POST

How to use Allow HTTP Header?

If the server responds with a 405 Method Not Allowed status code, the Allow HTTP Header must be sent to indicate which request methods are permitted. An empty Allow header indicates that the resource does not permit any request methods, which may occur briefly for a particular resource.

Examples of Allow HTTP Header Use

The following is an example of how to use the Allow HTTP Header. 

The HEAD method submits an entity to the specified resource, which frequently results in a state change on the server when there is only one method available.

Allow: HEAD

The PATCH method is used to make partial changes to a resource, whereas the DELETE method deletes it entirely when numerous methods are available.

Allow: PATCH, DELETE

What is the Specification Document for Allow HTTP Header?

There is only one specification document for Allow HTTP Header, which is RFC 7231. The RFC 7231 section 7.4.1 discusses the definition and usage of the Allow HTTP Header. The article also includes examples and values for the Allow HTTP Header.

What is the type of Allow HTTP Header?

The Allow HTTP Header is a Response Header type because it contains additional information about the response, such as its location or the server that generated it.

What are the similar HTTP Headers to the Allow HTTP Header?

There are other similar HTTP to the Allow HTTP Header. An example is listed below.

  • 405 Code: Similar to the Allow HTTP Header, the HyperText Transfer Protocol (HTTP) 405 Method Not Allowed response status code indicates that the server understands the request method, but the target resource does not support it.
  • Server HTTP Header: The Server HTTP Header is similar to the Allow HTTP Header. Similar to the Allow HTTP Header, which is also a response header, the Server HTTP Header describes the software used by the origin server that handled the request, that is, the server that generated the response.

Which Browsers Support Allow HTTP Header?

There is no compatible browser for the Allow HTTP Header

Holistic SEO
Follow SEO

Leave a Comment

Allow HTTP Header: Syntax, Directive, Examples

by Holistic SEO time to read: 3 min
0