Adding support for params without value.#1987
Merged
Merged
Conversation
Author
|
Note: Mocha tests weren't working to start with. Tried |
43081j
reviewed
Feb 5, 2019
nickstew
reviewed
Feb 5, 2019
nickstew
left a comment
There was a problem hiding this comment.
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.
Author
|
@nickstew as it is currently; we have full control over the resulting query: |
Contributor
|
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 |
IvanStoilov
pushed a commit
to IvanStoilov/axios
that referenced
this pull request
Nov 25, 2020
* 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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adds support for params without value when set to
null. (test included)undefinedcan still be used to exclude the param.Example:
This params object:
{ foo: null, bar: "baz", qux: undefined }Becomes this query string:
?foo&bar=bazThis resolves #1139.