HTTP

Definition

HyperText Transport Protocol (HTTP) is the communications method between internet-connected computers. It is a standards-based application protocol for use by computers but it has been designed to be simple to use and human readable.  HTTP Logo

Being human readable has reduced it complexity and contributed to its adoption and understanding.  

Established in the original standards specification the protocol is usable through the language of HTTP headers.  Headers are easy to use and make it easy to extend functionality and experiment with.  

HTTP is the core protocol of the world wide web enabling web server and browser vendors to standardize on the formatting of messages and how recipients of messages should respond and what actions they should take.

Each HTTP command executes independently of all commands irrespective of the order they are processed in.  This makes HTTP a stateless protocol as there is no link between any two requests transmitted between two computers over the same connection.

Usage

As the application protocol of the internet, through its request and response design HTTP implements a client server approach to enabling the serving of data from servers to clients (user-agents).

Client Server Model

HTTP commands can be view in source code.  They are basically keyword : value pairs but unfortunately do not conform to exact standards.  This has resulted in different implementations of HTTP parsers across the internet.  To address this inconsistency as part of the HTTP extensions initiative, the IETF HTTP working group is well advanced in developing a structured headers standard that is designed to standardize HTTP header syntax.    

 

The following is an example of HTTP Request source code.

 

 GET /standards/process/ HTTP/1.1 

 Host: ietf.org

 Connection: keep-alive Pragma: no-cache Cache-Control: no-cache

 Upgrade-Insecure-Requests: 1

 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko)  Chrome/80.0.3987.87 Safari/537.36

 Accept-Encoding: gzip, deflate, br

 Accept-Language: en-GB,en-US;q=0.9,en;q=0.8

 

The following is an example of HTTP Response source code.

 

 HTTP/1.1 200 OK 

 Date: Wed, 12 Feb 2020 13:45:39 GMT 

 Server: Apache 

 Vary: Cookie,Accept-Encoding 

 Content-Type: text/html; 

 charset=utf-8 

 Content-Length: 12593 

 Keep-Alive: timeout=5, max=1000 

 Connection: Keep-Alive

 

The above short examples show some of the commonly used headers. A more complete list of available headers can be found on the Message Headers web page of the IANA (Internet Assigned Numbers Authority) website.

Additional Information

HTTP is managed by the IETF HTTP working group.  It is an evolving protocol and the following are some of the standards that have been published.

HTTP/1.0 RFC 1945 - 1996

HTTP/1.1 RFC 2616 - 1999 

HTTP/2.0 RFC 7540 - 2015

Many other standards enabling the many different aspects of HTTP to be defined in detail. Some examples include:

  • RFC 7230 Hypertext Transfer Protocol (HTTP/1.1): Message Syntax and Routing Proposed Standard
  • RFC 7231 Hypertext Transfer Protocol (HTTP/1.1): Semantics and Content Proposed Standard
  • RFC 7232 Hypertext Transfer Protocol (HTTP/1.1): Conditional Requests Proposed Standard
  • RFC 7233 Hypertext Transfer Protocol (HTTP/1.1): Range Requests Proposed Standard
  • RFC 7234 Hypertext Transfer Protocol (HTTP/1.1): Caching Proposed Standard
  • RFC 5861 HTTP Cache-Control Extensions for Stale Content Informational
  • RFC 8246 HTTP Immutable Responses
  • RFC 7235 Hypertext Transfer Protocol (HTTP/1.1): Authentication
  • RFC 6265 HTTP State Management Mechanism
  • RFC 6585 Additional HTTP Status Codes
  • RFC 7538 The Hypertext Transfer Protocol Status Code 308 (Permanent Redirect)
  • RFC 7578 Returning Values from Forms: multipart/form-data
  • RFC 6266 Use of the Content-Disposition Header Field in the Hypertext Transfer Protocol (HTTP)
  • RFC 7239 Forwarded HTTP Extension
  • RFC 2817 Upgrading to TLS Within HTTP/1.1
  • RFC 7541 HPACK: Header Compression for HTTP/2
  • RFC 7838 HTTP Alternative Services
  • RFC 7301 Transport Layer Security (TLS) Application-Layer Protocol Negotiation Extension

The IETF HTTP working group maintains these RFCs and other documents, refer to HTTP Documentation  for the complete list.