danwrong / restler

REST client library for node.js
MIT License
1.99k stars 389 forks source link

Is it possible to add a body in a GET request? #227

Open jabrena opened 8 years ago

jabrena commented 8 years ago

Hi,

I would like to know if Restler allow sending a GET request with body with parameters.

Many thanks in advance.

Juan Antonio

zbentley commented 8 years ago

This seems like something that's not often needed, since GET is supposed to be body-free, and servers almost always ignore body fields with GET requests, if present:

Server semantics for GET, however, are restricted such that a body, if any, has no semantic meaning to the request. The requirements on parsing are separate from the requirements on method semantics.

So, yes, you can send a body with GET, and no, it is never useful to do so.