Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update GET and DELETE requests to take body #58

Closed
spruce-bruce opened this issue Nov 22, 2017 · 3 comments
Closed

Update GET and DELETE requests to take body #58

spruce-bruce opened this issue Nov 22, 2017 · 3 comments
Labels
changelog This issue should be included in the changelog / release notes

Comments

@spruce-bruce
Copy link
Contributor

The HTTP spec says that GET and DELETE requests don't have bodies, but sometimes you gotta.

Also, elastic search does a lot of GET body requests for large search requests (search is the most obvious use case for GET bodies).

Right now get takes a body object, but it just converts it to a query string and appends to the path. That functionality should either be removed or amended to add that to the body conditionally.

@chrisshiplet chrisshiplet added the changelog This issue should be included in the changelog / release notes label Mar 20, 2019
@chrisshiplet
Copy link
Contributor

Technically the spec allows for GET requests to have bodies and even clarified in 2014 by removing their message-body SHOULD be ignored (https://stackoverflow.com/a/983458), fetch throws a TypeError when you attempt to do this, and the maintainers seem to disagree with that spec (whatwg/fetch#551) so I don't see this happening in the foreseeable future.

@mkotsollaris
Copy link

Is there any more clarification on this issue? The HTTP protocol explicitly mentions that GET requests can have a body; is that impossible by using fetch? 🤯

@spruce-bruce
Copy link
Contributor Author

Fetch throws an error if you attach a body to the request. I haven't seen any new updates that make me think anything has changed

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
changelog This issue should be included in the changelog / release notes
Projects
None yet
Development

No branches or pull requests

4 participants