HTTP
Hypertext Transfer Protocol
Last updated
Hypertext Transfer Protocol
Last updated
HTTP is an application-layer protocol for transmitting hypermedia documents, such as HTML.
HTTP follows a classical client-server model, with a client opening a connection to make a request, then waiting until it receives a response from the server.
HTTP is a stateless protocol, meaning that the server does not keep any data (state) between two requests.
let the client and the server pass additional information with an HTTP request or response
Request headers - contain more information about the resource to be fetched, or about the client requesting the resource.
Response headers - hold additional information about the response, like its location or about the server providing it.
Representation headers - contain information about the body of the resource, like its MIME type, or encoding/compression applied.
Payload headers - contain representation-independent information about payload data, including content length and the encoding used for transport.
indicate the desired action to be performed for a given resource
Although they can also be nouns, these request methods are sometimes referred to as HTTP verbs.
Verbs | Description |
---|---|
| The |
| The |
| The |
| The |
| The |
All methods are , as well as
PUT
andDELETE
. ThePOST
method is not idempotent.
indicate whether a specific HTTP request has been successfully completed
Class | Codes | Description |
---|---|---|
1xx | Information reponses | |
2xx | Successful responses | |
200 | OK | |
201 | Created | |
204 | No Content | |
205 | Reset Content | |
3xx | Redirection messages | |
300 | Multiple Choices | |
301 | Moved Permanently | |
302 | Found | |
4xx | Client-error responses | |
400 | Bad Request | |
401 | Unauthorized | |
403 | Forbidden | |
404 | Not Found | |
429 | Too Many Requests | |
5xx | Server-error responses | |
500 | Internal Server Error | |
502 | Bad Gateway | |
503 | Service Unavailable | |
504 | Gateway Timeout |