Payloads of HTTP Request Methods

前端 未结 3 941
梦谈多话
梦谈多话 2020-11-29 16:09

The Wikipedia entry on HTTP lists the following HTTP request methods:

  • HEAD: Asks for the response identical to the one that would correspond t
3条回答
  •  青春惊慌失措
    2020-11-29 17:14

    I'm pretty sure it's not clear whether or not GET requests can have payloads. GET requests generally post form data through the query string, same for HEAD requests. HEAD is essentially GET - except it doesn't want a response body.

    (Side note: I say it's not clear because a GET request could technically upgrade to another protocol; in fact, a version of websockets did just this, and while some proxy software worked fine with it, others chocked upon the handshake.)

    POST generally has a body. Nothing is stopping you from using a query string, but the POST body will generally contain form data in a POST.

    For more (and more detailed) information, I'd hit the actual HTTP/1.1 specs.

提交回复
热议问题