httpx
httpx copied to clipboard
add support for any type of URL as long as it can be stringified
trafficstars
Summary
for reference : https://github.com/encode/httpx/discussions/3142
This PR brings compatibility with pydantic HttpURL object (or any object).
I'm using pydantic HttpURL type in my project (for validation purposes) but had errors when I passed the pydantic http object directly to https.request function. If the type of the given request is not httpx.URL, then the object will be stringified and the string will be passed on urlparse.
Checklist
- [x] I understand that this PR may be closed in case there was no previous discussion. (This doesn't apply to typos!)
- [x] I've added a test for each change that was introduced, and I tried as much as possible to make a single atomic change.
- [x] I've updated the documentation accordingly.