Copyright © tutorialspoint.com

HTTP Header Fields

previous next


Header lines provide information about the request or response, or about the object sent in the message body. This section will list out all the header fields available in HTTP Version 1.0

Allow

The Allow entity-header field lists the set of methods supported by the resource identified by the Request-URI. The purpose of this field is strictly to inform the recipient of valid methods associated with the resource.

Example

Allow: GET, HEAD

Authorization

The Authorization field value consists of credentials containing the authentication information of the user agent for the realm of the resource being requested.

Example

Authorization : credentials

Content-Encoding

The Content-Encoding entity-header field is used as a modifier to the media-type. When present, its value indicates what additional content coding has been applied to the resource, and thus what decoding mechanism must be applied in order to obtain the media-type referenced by the Content-Type header field. The Content-Encoding is primarily used to allow a document to be compressed without losing the identity of its underlying media type.

Example

Content-Encoding: x-gzip

Content-Length

The Content-Length entity-header field indicates the size of the Entity-Body, in decimal number of octets, sent to the recipient or, in the case of the HEAD method, the size of the Entity-Body that would have been sent had the request been a GET.

Example

Content-Length: 3495

Content-Type

The Content-Type entity-header field indicates the media type of the Entity-Body sent to the recipient or, in the case of the HEAD method, the media type that would have been sent had the request been a GET.

Example

Content-Type: text/html

Date

The Date general-header field represents the date and time at which the message was originated, having the same semantics as orig-date in RFC 822.

Example

Date: Tue, 15 Nov 1994 08:12:31 GMT

Expires

The Expires entity-header field gives the date/time after which the entity should be considered stale. This allows information providers to suggest the volatility of the resource, or a date after which the information may no longer be valid.

Example

Expires: Thu, 01 Dec 1994 16:00:00 GMT

From

The From request-header field, if given, should contain an Internet e-mail address for the human user who controls the requesting user agent. The address should be machine-usable, as defined by mailbox in RFC 822.

Example

From: webmaster@w3.org

If-Modified-Since

The If-Modified-Since request-header field is used with the GET method to make it conditional: if the requested resource has not been modified since the time specified in this field, a copy of the resource will not be returned from the server; instead, a 304 (not modified) response will be returned without any Entity-Body.

Example

If-Modified-Since: Sat, 29 Oct 1994 19:43:31 GMT

Last-Modified

The Last-Modified entity-header field indicates the date and time at which the sender believes the resource was last modified.

Example

Last-Modified: Tue, 15 Nov 1994 12:45:26 GMT

Location

The Location response-header field defines the exact location of the resource that was identified by the Request-URI. For 3xx responses, the location must indicate the server's preferred URL for automatic redirection to the resource. Only one absolute URL is allowed.

Example

Location: http://www.w3.org/hypertext/WWW/NewLocation.html

Pragma

The Pragma general-header field is used to include implementation-specific directives that may apply to any recipient along the request/response chain. All pragma directives specify optional behavior from the viewpoint of the protocol; however, some systems may require that behavior be consistent with the directives.

Example

Pragma = "Pragma" ":" 1#pragma-directive

pragma-directive = "no-cache" | extension-pragma

extension-pragma = token [ "=" word ]

Referer

The Referer request-header field allows the client to specify, for the server's benefit, the address (URI) of the resource from which the Request-URI was obtained.

Example

Referer: http://www.w3.org/hypertext/DataSources/Overview.html

Server

The Server response-header field contains information about the software used by the origin server to handle the request. The field can contain multiple product tokens and comments identifying the server and any significant subproducts.

Example

Server: CERN/3.0 libwww/2.17

User-Agent

The User-Agent request-header field contains information about the user agent originating the request. This is for statistical purposes, the tracing of protocol violations, and automated recognition of user agents for the sake of tailoring responses to avoid particular user agent limitations.

Example

User-Agent: CERN-LineMode/2.15 libwww/2.17b3

WWW-Authenticate

The WWW-Authenticate response-header field must be included in 401 (unauthorized) response messages. The field value consists of at least one challenge that indicates the authentication scheme(s) and parameters applicable to the Request-URI.

Example

WWW-Authenticate = "WWW-Authenticate" ":" 1#challenge


previous next

Copyright © tutorialspoint.com