Net HTTP overview

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 successful
  • 302: Temporary redirection, visit another URL
  • 404: The URL does not exist on the server
  • 502: gateway, proxy error
  • 503: The current service is busy and cannot process

field

  • Host: request domain name
  • Content-Length: Data length
  • Connection: Keep-Alive: Long connection
  • Content-Type: Data Format
  • Accept: supported data formats
  • Content-Encoding: compression method
  • Accept-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

Guess you like

Origin blog.csdn.net/qq_44226094/article/details/131774307