Sending POST data using a GET request?

Using Curl, for example, I can "send" data to a GET request. Is this the right thing? By this I mean:

  • Is any RFC specification prohibited?
  • Does anyone out there use it with good reason?

Thanks for any help.

+15
post get request
Jan 14 '10 at 13:20
source share
2 answers

See RFC2616 - Hypertext Transfer Protocol - HTTP / 1.1 , Section 4.3 โ€œMessage Bodyโ€:

The body of the message MUST NOT be included in the request if the specification of the request method (section 5.1.1) does not allow sending the body of the object to requests.

In Section 9.3, โ€œGET,โ€ including the entity body, is not prohibited.

So yes, you can send an entity body with an HTTP GET request.

+19
Jan 14 '10 at 13:33
source share

There is an option to use a "good reason."

elasticsearch uses body entity data in GET requests to try to use the GET verb as a read, and also allows for a more complex specification than just one URL (easy).

+4
Apr 15 '15 at 17:01
source share



All Articles