What are the HTTP headers
HTTP header explanation and definition
The Hypertext Transfer Protocol Header (HTTP Header) is part of a message (communication unit) with which data is sent from a server to a web browser via the HTTP protocol. A protocol consists of a series of information about the structure of a message, the sender, the recipient, the coding and the establishment of the connection. These are transmitted via the header. After the connection between client and server has been established, the client sends a request, which the server answers (response). The requested file is only sent and is visible in the browser when the parameters for establishing the connection have been compared. The HTTP header is made up of the information that is sent with a request and with a response, whereby different methods (GET, POST, PUT) are available depending on the request and, depending on the method, certain information is sent in order to clarify whether and how data can be exchanged between client and server.
HTTP header request fields
HTTP header fields are often imprecisely referred to as HTTP headers. In the following, the most important fields of a header request are briefly named and described in alphabetical order.
The Accept field indicates the file types of the request that the client expects. The field consists of a main and a subtype, separated by a slash.
Example: Accept: Text / HTML
The quality of the delivered file can also be specified, separated by a semicolon. Since browsers today can interpret and display almost all file types that can be sent, the specification * / * is usually made in the Accept field, which only indicates that it can be any file type.
The Accept Charset field indicates the character set that can be found in the requested document. If several character sets are used, these are separated by commas.
Example: Accept-Charset: utf-8
The character set utf-8 was chosen on purpose in this example. It is the most widespread coding that is congruent with the ASCII character set. This coding ensures that all characters and special characters can be written out and still be displayed correctly.
The Accept-Encoding field indicates which encoding method the client understands. The gzip, compress or deflate methods are usually used.
Example: Accept-Encoding: gzip
If more than one procedure is separated, they are separated by commas. A quality factor can also be specified here.
The Accept-Language field informs the server which languages the client prefers. Several entries are also separated by commas here.
Example: Accept-Language: de
The authorization field authenticates the client with the server, if this is necessary. Username and password are separated from each other by a colon.
Example: Authorization: BASIC SFRNTFdvcmxk: OkludGVybmV0
The word BASIC indicates the scheme according to which the character string was encrypted.
The cookie field is not an official HTTP header value. However, it is used very often in order to be able to identify the user when the page is viewed again. The field consists of one or more names separated by commas.
Example: Cookie: name = cookie
The expect field is rarely used. It is used to express an "expectation" and uses the value 100-to continue or a text. Several parameters can be separated by semicolons.
The From field contains the client's email address.
Example: From: [email protected]
The host field specifies the name of the server from which a file is to be retrieved. This value is optional for HTTP 1.0 and mandatory for HTTP 1.1. It is used to find the correct file on servers with multiple hostnames.
Example: Host: www.example.de:1234
The IF-Match field tells the server to send only one file that corresponds to the entity tag. If an asterisk * is given, all files are required. Here, too, multiple values are separated by commas.
The If-Modified-Since field tells the server to send a file only if its content has changed since the specified date.
If-Modified-Since: Tue, Apr 07, 2004 23:24:25 GMT
The If-None-Match field does the opposite of the If-Match field. It tells the server to only send the file if it does not match the specified entity field. Here, too, several values are separated with commas.
Example: If-None-Match: "ga-j647d"
The If-Range field is used for intermediate storage of files and is used in conjunction with the Range header field. It tells the server to send only the missing parts of a file if the file has not changed. If the file has been changed, the entire file should be sent instead of a part.
Example: If-Range: Tue, Apr 09, 2012 23:33:25 GMT
The If-Unmodified-Since field tells the server to send a file only if it has not been modified since the date specified as the value.
Example: If-Unmodified-Since: Tue, Apr 12, 2011 23:25:28 GMT
The Max Forwards field only appears in TRACE and options requests (see HTTP). The value specified is a number that tells the proxy servers the maximum number of times a message can be forwarded. If a message with this field arrives at a proxy server, the proxy server reduces the value by 1. If the value is zero, then the proxy forwards the message back to the client.
Example: Max-Forwards: 5
The Proxy-Authorization field is used to authenticate a client to a proxy. Here, too, the coding method is placed in front of the character string.
Example: Proxy Authorization: BASIC SGRMTDdvcnxlPklrdHVycmVP
The range field is used to request one or more areas of a file that the client still needs. A so-called byte index is specified as the area specification. Multiple entries are separated by commas.
Example: Range: bytes = 50-99,200-250
The referer field contains the URL from which the requested file is referenced. A relative or absolute URL can be specified as the value.
Example: Referer: http://www.beispielname.de
The TE field specifies which coding method the client allows for the request.
Example: TE: gzip; q = 0.9
With the user agent field, the client can inform the header about itself. The product name of the browser can be specified here as a value.
Example: User agent: Mozilla / 3.1
HTTP header response fields
HTTP header fields are often imprecisely referred to as HTTP headers. The following describes the most important fields of a header response in alphabetical order.
Accept-Ranges field, the server indicates to the client that it is accepting requests as a sequence. It can contain the values bytes for a byte range or the value none if no ranges are allowed.
The Age field indicates the age of the requested file in seconds.
Example: Age: 1234
The Etag field gives the client a unique designation of the accessed file, which is used by the server to uniquely locate the file. It can be used by the client in conjunction with the If-Match, If-None-Match, and If-Range fields.
Example: ETag: "hag735m"
The server uses the Location field to tell the client the new position of a document if it has moved. An absolute URL is specified as the value.
Example: Location: http: //www.domain.tld
The Proxy-Authenticate field tells the client that the proxy wants authentication. Values are the encoding scheme and realm for which authentication is expected.
Example: Proxy-Authenticate: Basic realm = "XTMLWorld"
The Retry-After field tells the client to retry a request at a later time. The time period in seconds or an HTTP date is specified as the value.
Example: Retry-After: 1234
The server field reveals additional information about the server. For example the server software.
Example: Server: Apache / 2.0
The set cookie field instructs the client to save a cookie. It can also contain information about the period of validity and the path for which the cookie should be valid.
The Vary header field tells the client that there are multiple sources for its request. It also contains information on the language or the file type.
The WWW-Authenticate field tells the client that it needs to authenticate.
- Is Diana Penty really beautiful
- How is the provided Bitcoin blockchain hosted
- Is reading other text messages illegal?
- Can Ethereum recover in 2019
- Can ERCP sphincterotomy cure recurrent acute pancreatitis
- Which lipoprotein is high in triglycerides
- How to pronounce the name Eunice
- What do people think in general
- Can we bring Imperial Japan back?
- How did Parikshit die and why
- What is Apache Nifi
- Why don't isolators behave
- What is algebraic topology in layman's terms
- Which song just makes you cry
- Eat spiders earwigs
- What is emotionally suppressed
- What's in a Good PPC Report
- What cures dandruff
- What companies are using Angular 6 in India
- Why are police officers afraid of criminals
- What is the plural of cadmium
- How is the blue tape different
- Is a juice safe quickly
- What opinions do atheists have on pantheism?