Hypertext Transfer Protocol (HTTP)
  • is an application-layer/network-level API protocol for transmitting hypermedia documents (e.g. HTML, JavaScript, CSS, etc)
  • it was designed for communication between web clients and web servers
  • HTTP follows a classical client-server model, with a client opening a connection to make a request, then waiting until it receives a response
  • HTTP is a stateless protocol, meaning that this protocol does not have builtin “sessions”

HTTP - History

  • HTTP is the underlying communication protocol of the World Wide Web
  • It was invented by Tim Berners-Lee at CERN between 1989 and 1991, and open-sourced in 1993

HTTP - Request & Response

HTTP Request

HTTP Response

Template

Request-Method /Request-Resource HTTP-Version
HTTP Headers

HTTP Request Body (depends on Request-Method)

HTTP-Version HTTP Response CodeHTTP Headers

HTTP Response Body

Example

POST /test/resource HTTP/1.1
Host: foo.example.com Content-Type: application/x-www-form-urlencoded
Content-Length: 27field1=value1&field2=value2

HTTP/1.1 200 OK
Server: nginx/1.12.2
Content-Type: text/html
Content-Length: 12292

<html><header></header><body><p>Hello, World</p></body></html>

Other

HTTP - Specifications

HTTP - Implementations