Net HTTP overview
HTTP (HyperText Transfer Protocol) : Hypertext Transfer Protocol
- Hypertext: richer than text
- Transmission: two-way communication
- agreement: an agreement between two parties
status code
200
: OK , everything is successful302
: Temporary redirection, visit another URL404
: The URL does not exist on the server502
: gateway, proxy error503
: The current service is busy and cannot process
field
Host
: request domain nameContent-Length
: Data lengthConnection: Keep-Alive
: Long connectionContent-Type
: Data FormatAccept
: supported data formatsContent-Encoding
: compression methodAccept-Encoding
: supported compression methods
Get/Post
- GET : Get the specified resource from the server
- POST : Process the specified resource according to the request body
Safe/idempotent:
-
Safe: requests do not destroy service resources
-
Idempotent: execute multiple times, the result is the same
-
GET : Safe and idempotent, browsers, proxies, all will cache
-
POST : unsafe, not idempotent, will modify service resources, multiple submissions will create multiple resources