-
-
Notifications
You must be signed in to change notification settings - Fork 935
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
Add an option to allow GET with body #1074
Comments
Wouldn't it be clearer with an option called |
Sure. |
In addition, to anyone that decides to work on this. The docs should strongly advice against using this option and explain that it's an anti-pattern and that HTTP2 doesn't allow a GET with body. That it's only meant to interact with non-compliant servers when you have no other choice. |
Hey @sindresorhus , i just migrated from request to got and might have a edge case where I may have to support a body on a GET request. I was looking through the code and it would like to contribute a PR to fix this issue with the option |
Sure. Feel free.
Personally I think that we shouldn't do that for HEAD, as it's used only for scraping headers. If there would be any use case, then it should be another issue. |
Should be fixed with PR #1081 |
I think this issue can be closed @sindresorhus @szmarczak |
Currently Got throws
TypeError: The
when you try to upload some data using the GET method. The RFC 7231 doesn't specify any particular behavior regarding this situation. Undefined behavior is considered to be an anti-pattern.GET
method cannot be used with a bodyAlthough this has been discussed in some issues, there are many people who are still interested in this. Sometimes the HTTP servers don't follow the RFC. We have already added an option to ignore invalid cookies. The proposed solution is to disable the error via another option, for example
ignoreStrictPayload
allowGetBody
.The text was updated successfully, but these errors were encountered: