HTTP Explained

HTTP codes

Common HTTP status codes:

100 Informational response

2xx success

This class of status codes indicates the action requested by the client was received, understood, and accepted

200 OK The request succeeded, and the resulting resource (e.g. file or script output) is returned in the message body.

3xx redirection

301 Moved Permanently

302 Moved Temporarily

303 See Other (HTTP 1.1 only)

The resource has moved to another URL (given by the Location: response header), and should be automatically retrieved by the client. This is often used by a CGI script to redirect the browser to an existing file.

4xx client errors

This class of status code is intended for situations in which the error seems to have been caused by the client.

403 Forbidden The request was a valid request, but the server is refusing to respond to it.

404 Not Found The requested resource doesn’t exist.

5xx server errors

The server failed to fulfil a request.

Response status codes beginning with the digit "5" indicate cases in which the server is aware that it has encountered an error or is otherwise incapable of performing the request.

500 Internal Server Error An unexpected server error. The most common cause is a server-side script that has bad syntax, fails, or otherwise can’t run correctly.

503 Service Unavailable The server is currently unavailable (because it is overloaded or down for maintenance). Generally, this is a temporary state.

HTTP Methods

GET - The GET method is used to retrieve information from the given server using a given URI. Requests using GET should only retrieve data and should have no other effect on the data.

HEAD - Same as GET, but transfers the status line and header section only.

POST - A POST request is used to send data to the server, for example, customer information, file upload, etc. using HTML forms.

PUT - Replaces all current representations of the target resource with the uploaded content.

DELETE- Removes all current representations of the target resource given by a URI.

CONNECT - Establishes a tunnel to the server identified by a given URI.

OPTIONS - Describes the communication options for the target resource.

TRACE - Performs a message loop-back test along the path to the target resource.

continue -

HTTP Headers




HTTP versions

What are the differences between HTTP 1.0 and HTTP 1.1?

The difference between HTTP 1.0 and HTTP 1.1 is that In To signify successful requests and to identify transmission problems, HTTP 1.0 Status codes were utilized. ... HTTP 1.1 also provides for persistent connections, which implies that many responses and requests can be sent over the same HTTP connection.

What are the differences between HTTP 1.1 and HTTP 2?

As opposed to HTTP/1.1, which keeps all requests and responses in plain text format, HTTP/2 uses the binary framing layer to encapsulate all messages in binary format, while still maintaining HTTP semantics, such as verbs, methods, and headers.