What is HTTP?

HTTP stands for Hypertext Transfer Protocol and runs on top of TCP. It specifies what messages the client sends to the server and what response it gets.

HTTP and HTTPS?

HTTPS is the secure version of HTTP, which is a certificate added to SSL.

What’s the difference between HTTP and HTTPS?

  • HTTPS requires a CA certificate. Free certificates are rare and must be paid.
  • HTTPS and HTTP have different ports. HTTP has port 80 and HTTPS has port 443.
  • HTTP transmits information in plaintext, while HTTPS uses secure SSL encryption transmission protocol.
  • HTTP connections are stateless. HTTPS is a network protocol constructed using SSL and HTTP to encrypt transmission and authenticate identity. HTTPS is more secure than HTTP.

2xx

The result of the 2xx response indicates that the request was processed normally

  • 200 OK

Indicates that the request sent by the client has been successfully processed by the server

  • 204 No Content

Indicates that the request received by the server is successfully processed, but the response packet does not contain the body part of the entity. This parameter is used when only the client needs to send information to the server without sending new information to the client

  • 206 Partial Content

This status code indicates that the client has made a Range request, and the server has successfully executed this part of the GET request response message containing the entity Content specified by the content-Range

3xx

The response results of 3xx indicate that the browser needs to perform some special processing to properly process the request. When the response status code 301,302,303 is returned, the browser almost always changes the POST to GET and deletes the entity in the request message.

  • 301 Moved Permanently

Permanently redirected, the request status code has been reassigned to a new URI, and the current URI will be used later.

  • 302 Found

Temporary redirects, similar to 301, except that the new URI is not permanent, but temporary.

  • 303 See Other

The GET method should be used to GET the requested resource because another URI exists for the resource corresponding to the request. Unlike 302, 303 specifies that resources are requested using GET.

  • 304 Not Modified

When a client sends a conditional request, the server allows access to the resource, but the condition is not met. 304 does not return any response to the body of the body. 304 has nothing to do with redirection.

  • 307 Temporary Redirect

Temporary redirection, which has the same meaning as 302, which forbids POST but the browser does not follow, 307, which complies with browser standards.

4xx

4xx indicates that the client is faulty.

  • 400 Bad Request

It indicates that there is a problem in the request packet. After the request occurs, you need to modify the request content and send the request again. Otherwise, the browser treats the request as 200.

  • 401 Unauthorized

The status code indicates that the request must be authenticated through HTTP (BASIC authentication or DIGEST authentication). In addition, if a request has been made before, the user authentication fails and the response containing 401 must contain a WWW-authenticate header that applies to the requested resource to challenge the user. When the browser receives the 401 response for the first time, an authentication dialog will pop up.

  • 403 Forbidden

Indicates that the requested resource is disabled by the server. Like authorization.

  • 404 Not Found

The requested resource could not be found.

  • 405 Method Not Allowed

The client method is recognized by the server, but the server forbids it.

5xx

5xx indicates that a server error occurs

  • 500 Internal Service Error

An error occurred while the server was executing the request.

  • 502 Bad Gateway

This status code indicates that the server acting as a gateway or proxy received an invalid response from the upstream server.

  • 503 Service Unavaliable

Indicates that the server is under load or maintenance and cannot process requests at this time.