curlify
curlify copied to clipboard
Httpx support
Add support for httpx
As httpx strives for close compatibility with requests few changes needed to be made in curlify
- .lower() on headers (headers in http are case insensitive and httpx / requests use different cases.
- httpx does not have a .body but contents can be accessed via .read() instead, curlify will now use either or.
- httpx stores url in as URL object so we stringify it.
Majority of the changes are in tests.
- all tests are mocked out so there is no hitting of external services
- payload tests are more relaxed. Testing for approximate existence of flags rather than exact string match. This is a workaround to deal with various discordant optional http headers.
Unrelated changes include a makefile to aide with testing and update of testing requirements.
I know this library has a long time since anything has been merged, but I would love to use this change!