NOTE

2.6 HTTP

Historical HTTP overview covering messages, URLs, methods, status codes, versions, caching, cross-origin access, push, cookies, HTTPS, RESTful, and Fiddler.

Computer NetworksCreated Updated 1 min readhistorical

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

URL Encoding

3. HTTP Methods

HTTP Methods

4. HTTP Status Codes

HTTP Status Codes

5. HTTP Versions

HTTP Versions

6. HTTP Cross-Origin Access

Browser Same-Origin Policy and Cross-Origin Access

7. HTTP Cache

HTTP Cache

8. HTTP Persistent Connections

HTTP KeepAlive

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 are not timely.
    • Repeatedly opening and closing connections consumes resources.

9.2. WebSocket

  • WebSocket
  • Advantages:
    • Messages are timely.
  • 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 keeps waiting for the request to return.
  • Advantages:
    • Messages are timely.
  • Disadvantages:
    • Maintaining connections consumes server resources.

Cookie and Session

11. HTTPS

HTTPS

12. RESTful

RESTful

13. Packet-Capture Tools

14. Fiddler

Fiddler

Discussion

Sign in with GitHub to comment. Discussions are stored as GitHub Issues.View on GitHub