1Password / connect-sdk-python

Python SDK for 1Password Connect
https://developer.1password.com/docs/connect
MIT License
200 stars 30 forks source link

Leave JSON encoding to HTTPX #87

Closed mjpieters closed 8 months ago

mjpieters commented 11 months ago

HTTPX accepts JSON-encodable objects directly, there is no need for this project to 'manually' encode the data to JSON.

By passing the body object directly to HTTPX, the library can then also handle the appropriate client headers (Content-Type specifically).

Finally, this also neatly addresses the deprecation warning that HTTPX emits whithout this change: Use 'content=<...>' to upload raw bytes/text content.. The latter could also be avoided by using content=serialized_body instead of data=serialized_body.

volodymyrZotov commented 8 months ago

Hi, @mjpieters. I'm sorry for not getting back to you sooner. This change looks good! I'm about to merge it. Could you resolve the conflict, please?

codecov-commenter commented 8 months ago

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Comparison is base (bf1c6fa) 76.89% compared to head (dc5e390) 76.88%.

:exclamation: Your organization needs to install the Codecov GitHub app to enable full functionality.

Additional details and impacted files ```diff @@ Coverage Diff @@ ## main #87 +/- ## ========================================== - Coverage 76.89% 76.88% -0.02% ========================================== Files 27 27 Lines 1909 1908 -1 ========================================== - Hits 1468 1467 -1 Misses 441 441 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.