HTTP stands for HyperText Transport Protocol.
1) A client machine makes a request to a server.
The request is a text document containing a Verb, Headers, and Content.
ex: POST, Content Length: 11, Hello World
2) The server processes the request and may return a response.
The response is a text document containing a Status Code, Headers, and Content.
ex: 201, Content Type: text, Hello World
The server is stateless. It process each request individually.
The HTTP Request document.
The action to perform on the server.
GET - request a resource
POST - create a resource
PUT - update a resource
PATCH - update parts of a resource (ex: the address of the customer, not the whole customer)
DELETE - delete a resource
Metadata about the request.
A set of Name/Value pairs.
Content Type - the format of the content
Content Length - size of content
Authorization - who is making the request
Accept - the formats I can accept in the response
Cookies - state data
Could be any data.
The content format may be limited by the Verb.
For instance, GET requests don't have any Content because they are just requesting information.
The HTTP Response document.
The status of the requested operation.
400-499: client errors
500-599: server errors
Similar to the request headers.
Expires - when the data is considered stale
Similar to the request content.