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
Adding support for params without value. #1987
Adding support for params without value. #1987
Conversation
Note: Mocha tests weren't working to start with. Tried |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me. Minimal change. If not stated in the documentation, this should be expressly stated in the README. Should there be a flag to treat null
and undefined
as the same? I see each pattern being used in production environments.
@nickstew as it is currently; we have full control over the resulting query: |
this is sort of a breaking change so I'll wait until 0.20.0 or 1.0.0 to release this, probably right after 0.19.1 |
* Added support for params without value. Resolves axios#1139. * Replaced unnecessary typeof check. Co-authored-by: Kimmo Liikaluoma <kimmo@oadata.se> Co-authored-by: Emily Morehouse <emilyemorehouse@gmail.com> Co-authored-by: Yasu Flores <carlosyasu91@gmail.com>
Adds support for params without value when set to
null
. (test included)undefined
can still be used to exclude the param.Example:
This params object:
{ foo: null, bar: "baz", qux: undefined }
Becomes this query string:
?foo&bar=baz
This resolves #1139.