HTTP Learning Notes

Source: Internet
Author: User
Tags error status code

1.TCP/IP Protocol Family

Layering: Application layer http/dns/ftp. Transport Layer TCP/UDP. Network layer Ip/arp. Data link layer (handles the hardware portion of the connected network)

TCP Three-time handshake: The sending side sends the SYN, the receiving side sends the Syn/ack, and the sender sends the ACK again.

HTTP Communication process: Client input domain name, DNS lookup IP address through domain name. The HTTP protocol generates HTTP request messages for the target Web server. The TCP protocol divides the HTTP request message into a message segment, adds the tag sequence number and the port number separately, and transmits a reliable (three handshake) message to each other. The IP protocol searches for the address of the other, increasing the MAC address as the destination of the communication, while relaying. The server-side TCP protocol reorganizes the received message segment into a request message sequentially. The HTTP protocol processes the content requested by the Web server. The contents of the response are also passed on to the client in the same way.

2.HTTP protocol

The HTTP protocol must first establish communication from the client. For a communication route, the role of the server side and the client is fixed.

HTTP is a stateless protocol.

HTTP maintains the TCP connection state, and multiple HTTP requests and responses can be made after a TCP connection is established.

HTTP pipelining: The next request does not have to wait for the last response to complete.

The cookie is state-managed: The server adds the Set-cookie header field in the response message, notifies the client to save the cookie, and the next time the client sends a request to the server, the client adds a cookie header field to the request message, and the server discovers the cookie for the request message. Check exactly which client sent the connection request, then compare the server's record, and finally get the status information.

3.HTTP messages

Message sub-Request message and response message. The message is composed of the message header + empty line + message body.

Request message header: Request line, request header field, General header field, Entity header field, other

Response message header: status line, Response header field, General header field, Entity header field, other

HTTP status code: 1XX Informational Status Code, the accepted request is being processed.

2XX Success Status code, request normal processing completed. 200,204 (response does not return resources)

3XX REDIRECT Status code, requires additional operation to complete the request. 304 (the server resource has not changed, can directly use the client's non-expired cache)

4XX Client Error status code, the server cannot process the request. 403 (do not allow access to the Resource) 404 (the server cannot find the requested resource)

5XX Server Error status code, server processing error. 500 (server Internal Error) 503 (server is overloaded or downtime is maintained)

4.WEB Server

Proxy: Is forwarded between the client and the server. Function: Cache, access control, get access log.

Gateway: When receiving a client request, treat the request as if it were the source server. Role: You can make the gateway communicate with the server to provide non-HTTP protocol services.

Tunnels: Relay to clients and servers that are far apart, maintaining communication connections between the two sides. Function: Secure Communication guaranteed

Cache: A proxy server or a copy of a resource saved locally by the client. Reduce access to the source server, saving traffic and time. After you have determined that the cache has expired, confirm the validity of the cache to the source server.

5.

HTTP Learning Notes

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.