-
Notifications
You must be signed in to change notification settings - Fork 45
Fixed #63: Support HTTPX params argument #81
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
Conversation
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.
Awesome to see some light on this!
Ticks one feature of #79 |
FYI @jocke-l , Still, your current |
dfc9027
to
4d60bee
Compare
Let's do the final touches to simplify our code in |
90c0ada
to
f4992f8
Compare
6b02739
to
4ded5f7
Compare
9b0852f
to
24088f6
Compare
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.
Almost there...
6956203
to
314b021
Compare
314b021
to
a82892a
Compare
a82892a
to
d63f338
Compare
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.
Legit!
Added - Added `text`, `html` and `json` content shorthands to ResponseTemplate. (PR #82) - Added `text`, `html` and `json` content shorthands to high level API. (PR #93) - Added support to set `http_version` for a mocked response. (PR #82) - Added support for mocking by lowercase http methods, thanks @lbillinghamtn. (PR #80) - Added query `params` to align with HTTPX API, thanks @jocke-l. (PR #81) - Easier API to get request/response from call stats, thanks @SlavaSkvortsov. (PR #85) - Enhanced test to verify better content encoding by HTTPX. (PR #78) - Added Python 3.9 to supported versions and test suite, thanks @jairhenrique. (PR #89) Changed - `ResponseTemplate.content` as proper getter, i.e. no resolve/encode to bytes. (PR #82) - Enhanced headers by using HTTPX Response when encoding raw responses. (PR #82) - Deprecated `respx.stats` in favour of `respx.calls`, thanks @SlavaSkvortsov. (PR #92) Fixed - Recorded requests in call stats are pre-read like the responses. (PR #86) - Postponed request decoding for enhanced performance. (PR #91) - Lazy call history for enhanced performance, thanks @SlavaSkvortsov. (PR #92) Removed - Removed auto setting the `Content-Type: text/plain` header. (PR #82)
This PR adds support for
params
argument (#63) torespx.add
and it's shortcuts. It does so by using httpx.QueryParams which seems to be "publicly" exposed. I'm open for other solutions too, but I think it's easier to be on par with httpx' API this way.It also makes all other parameter except
method
andurl
keyword-only arguments, which means this code may break existing test suites. The reason for this is to be able to arrange the arguments in a natural way and avoid further backward incompatibilities in the future.