GET with Body is necessary on some APIs #1524
Replies: 2 comments
-
The browser don't allow you to make any request with a body using a GET. So b/c browsers have such a big roll in what most request are being made from then then i think it's also bad to enable it and encourage other developer to not rely on a GET request to have any payload. we also have a spec to follow that says that body with a get request should throw elasticsearch knows this so it also allow you to make a POST request to search for things |
Beta Was this translation helpful? Give feedback.
-
This library is an implementation of ref: https://fetch.spec.whatwg.org/#request-class Because of this, I think that this feature request is better targeted towards the fetch spec rather than to this implementation? |
Beta Was this translation helpful? Give feedback.
-
Referencing this issue: #1377
Unfortunately, there are APIs that need GET with body: Shortcut is one, Elastic is another. There may be also private APIs that need this behavior. There's also no mention on the RFC that it's is, indeed, forbidden: https://datatracker.ietf.org/doc/html/rfc7231#section-4.3.1:
Please, consider removing
throw new TypeError('Request with GET/HEAD method cannot have body');
from the library, or at least allow the user to bypass this limitation.Beta Was this translation helpful? Give feedback.
All reactions