HTTP
Hyper Text Transfer Protocol
- Stateless : every Request is INDEPENDENT
- regard each request as a single transaction
- use
cookie
session
localStorage
… to enhance user experience( memorize the state from the user )
HTTPS
Hyper Text Transfer Protocol Secure
- Data sent is encrypt
- SSL – Secure Sockets Layer
- TLS – Transfer Layer Security
- install certificate on web host to use HTTPs
Message
Headers
- General
- Request URL、Request Method、Status Code、Remote Address、Referrer Policy
- Request
- Cookies、Accept-xxx、Content-Type、Content-Length、Auhurization、User-Agent、Referrer
- Response
- Server、Set-Cookie、Content-Type、Content-Length、Date
Status Code
Status Code | Means |
---|---|
1xx | request received / processing |
2xx | Success received, understood, accepted |
3xx | Further action must be taken / redirect |
4xx | Client error |
5xx | Server error |
- 200 - OK
- 201 - OK created
- 301 - Move to new URL
- 304 - Not Modified (Cached version)
- 400 - Bad Request (❌ not sending correct data)
- 401 - Unauthorized (missing token)
- 404 - Not Found (resources do not exsist)
- 500 - Internal Server Error
HTTP2
multiplexing