About
The Hypertext Transfer Protocol (HTTP) is the foundation of the World Wide Web, and is used to load webpages using hypertext links. HTTP is an application layer protocol designed to transfer information between networked devices and runs on top of other layers of the network protocol stack.1.
Typical HTTP Flow
A typical flow over HTTP involves a client machine making a request to a server, which then sends a response message1.
HTTP headers
See HTTP headers
HTTP request
See HTTP request
HTTP response
It is what the clients (e.g. browsers) receive from an Internet server in response/ answer to an HTTP request. They communicate valuable information based on what was requested/ asked for in the HTTP request. They typically contain:
- an HTTP status code
- HTTP response headers
- optional HTTP body
HTTP status code2
It is a 3-digit code used to indicate whether an HTTP request has been successfully completed. They are broken into 5 blocks:
Status Code | Status Code Message | Status Code Description |
---|---|---|
100-199 | Information Responses | - |
100 | Continue | An interim response which indicates that the client should continue the request or ignore the response if the request is already finished |
101 | Switching Protocols | The code is sent in response to an Upgrade request header from the client and indicates the protocol the server is switching to |
102 | Processing | It was used with WebDAV contexts to indicate that a request has been received by the server, but no status was available at the time of the response |
103 | Early Hints | Primarily intended to be used with the Link header, letting the user agent start preloading resources while the server prepares a response or preconnect to an origin from which the page will need resources |
200-299 | Success Responses | - |
200 | OK | The request succeeded. The result and meaning of “success” depends on the HTTP method: GET: the ressource has been fetched and transimitted in the message body; HEAD: representation headers are included in the response without any message body; PUT or POST: the resource describing the result of the action is transimitted in the message body; TRACE: the message body contains the request as received by the server |
201 | Created | The request succeeded, and a new resource was created as a result. This is typically the response sent after POST requests, or some PUT requests |
202 | Accepted | The request has been received but not yet acted upon. It is noncommittal, since there is no way in HTTP to later send an asynchronous response indicating the outcome of the request. It is intended for cases where another process or serer handles the request, or for batch processing. |
203 | Non-Authoritative Information | This response code means the returned metadata is not exactly the same as is available from the origin server, but is collected from a local or a third-party copy. This is mostly used for mirriors or backups of another resource. Excdpt for that specific case, the 200 OK response is preferred to this status |
204 | No Content | There is no content to send for this request, but the headers are useful. The user agent may update its cached headers for this resource with the new ones. |
205 | Reset Content | Tells the user agent to reset the document which sent this request. |
206 | Partial Content | This response code is used in response to a range request when the client has requested a part or parts of a resource. |
207 | Multi-Status (WebDAV) | Conveys information about multiple resources, for situations where multiple status codes might be appropriate. |
208 | Already Reported (WebDAV) | Used inside a <dav:propstat> response element to avoid repeatedly enumerating the internal members of multiple bindings to the same collection. |
226 | IM Used (HTTP Delta encoding) | The server has fulfilled a GET request for the resource, and the response is a representation of the result of one or more instance-manipulations applied to the current instance. |
300-399 | Redirection Messages | - |
300 | Multiple Choices | In agent-drien content negotiation, the request has more than one possible response and the user agent or user should choose one of them. There is no standardised way for clients to automatically choose one of the responses, so this is rarely used. |
301 | Moved Permanently | The URL of the requested resource has been changed permanently. The new URL is given in the response. |
302 | Found | This response code means that the URL of the requested resource has has changed temporarily. Further changes in the URI might be made in the future, so the same URI should be used by the client in future requests. |
303 | See Other | The server sent this response to direct the client to get the requested resource at another URI with a GET request. |
305 | Use Proxy | Defined in a previous version of HTTP specification to indicate that a requested response must be accessed by a proxy. It has been deprecated due to security concerns regarding in-band configuration of a proxy. |
306 | unused | This response code is no longer used; but is resereved. It was used in a previous version of the HTTP/1.1 specification. |
307 | Temporary Redirect | The server sends this response to direct the client to get the requested resource at another URI with the same method that was used in the prior request. This has the same semantics as the 302 Found response code, with the exception that the user agent must not change the HTTP method used: if a POST was used in teh first request, a POST must be used in the redirected request. |
308 | Permanent Redirect | This means that the resource is now permanently located at another URI, specified by the Location response header. This has the same semantics as the 301 Moved Permanently HTTP response code, with the exception that the user agent must not change the HTTP method used: if a POST was used in the first request, a POST must be used in the second request. |
400-499 | Client Error Responses | |
400 | Bad Request | The server cannot or will not process the request due to something that is perceived to be a client error (e.g., malformed request syntax |
400 | ||
500 - server error | Server Error Responses | |
Anki
Links
References
Cloud Flare. “Hypertext Transfer Protocol (HTTP)”. Available at: https://www.cloudflare.com/learning/ddos/glossary/hypertext-transfer-protocol-http/ . (Accessed: ). ↩︎ ↩︎
Mozilla Developer Network. “HTTP response status codes”. Available at: https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Status#informational_responses . (Accessed: ). ↩︎