HTTP messages are composed of a header and message body containing the data.
Header lines provide information about the request or response, or about the object sent in the message body. A header line is ASCII text in the form “header-name:value”. The “header-name” is not case-sensitive although the “value” may be. A header may have as many header lines as needed.
Section 14 of RFC 2616 Fielding, et al., Hypertext Transfer Protocol – HTTP/1.1 defines header lines.
For requests, the Torrent Suite™ Software API usually only requires headers to be specified for PUT, POST, and DELETE methods. For GET requests, the necessary information is provided as a parameter. Response messages from the server always include a header.
Topics on this page:
A request header might be as simple as the following example:
Content-Type:application/json
This specifies the format of the transmitted data, if it is not specified as a parameter.
A response header is usually similar to the following example:
Status Code:200 OK
Date: Wed, 01 Jun 2011 22:38:49 GMT
Server: Apache/2.2.2.14 (Ubuntu)
Content-Type: application/json; charset=utf-8
Keep-Alive: timeout=15, max=100
Connection: Keep-Alive
Transfer-Encoding: chunked
The Status Code is of particular interest, and the Content-Type header line describes the data format.