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.
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
[core] add query kwarg to HttpRequest #16942
[core] add query kwarg to HttpRequest #16942
Changes from 2 commits
3bd9c45
a08a86e
8198d86
72d9b0b
8324f56
4cb950f
6dde7f0
c2c5e2d
ced6aaf
2bb425f
a4c94c0
62612c3
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
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.
The
query
parameter should take a sequence of key-value tuples in addition to adict
. Many services allow/require the same query parameter multiple times (something similar tohttp://contoso.com/api?item=1&item=2&item=7
)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.
@johanste would it be ok to keep it as
Dict[str, Any]
for this release so we get thequery
kwarg in place? Currently core only acceptsDict[str, Any]
informat_parameters
, so this would be at parity. For next release, I can open an issue to expand query to allow in lists of tuples etc, following httpx's possible valuesThere 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.
How would we format something like
query={ 'items': [ 'a', 'b', 'c', 'd' ] }
?I believe we need to be very explicit about if/when/what we encode and how (and this should also translate into specific test cases to make sure we don't break stuff)
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.
I'd like to see a test when there was no query in the first place (to also check we add correctly the ?