NOTE
2.6 HTTP
HTTP requests contain a request line, headers, and a body, with a corresponding structure for responses. These notes start with message formats and basic HTTP usage.
This is a historical learning note and may contain outdated or incomplete understanding.
1. HTTP Message Format
1.1. Request
- Request line
- Request headers
- Blank line
- Request body
1.2. Response
- Status line
- Response headers
- Blank line
- Response body
2. URL
3. HTTP Methods
4. HTTP Status Codes
5. HTTP Versions
6. HTTP Cross-Origin Access
Browser Same-Origin Policy and Cross-Origin Access
7. HTTP Cache
8. HTTP Persistent Connections
9. HTTP Server Push
9.1. Client Polling
- The client sends an HTTP request to the server every 5 seconds. If the server has a new message, it returns it.
- Advantages:
- Simple to implement.
- Messages are not lost.
- Disadvantages:
- Messages arrive with a delay.
- Repeatedly opening and closing connections consumes resources.
9.2. WebSocket
- WebSocket
- Advantages:
- Messages arrive promptly.
- Disadvantages:
- Messages may be lost.
9.3. HTTP Long Polling
- The client sends an HTTP request. If the server has a new message, it returns immediately; otherwise, the server holds the connection and the client waits for the response.
- Advantages:
- Messages arrive promptly.
- Disadvantages:
- Maintaining connections consumes server resources.
10. Cookie and Session
11. HTTPS
12. RESTful
13. Packet-Capture Tools
14. Fiddler
Drag to pan, scroll to zoom, and click a node to expand or collapse it. Large maps start with deeper levels collapsed; click nodes to expand them.
Discussion
Sign in with GitHub to comment. Discussions are stored as GitHub Issues.View on GitHub