twisted / treq

Python requests like API built on top of Twisted's HTTP client.
Other
587 stars 139 forks source link

Support content-type overrides #289

Open mattwwarren opened 4 years ago

mattwwarren commented 4 years ago

This may be related to #132 so feel free to fold it into that but we ran into a scenario where we had to pass a meaningless files= kwarg to HTTPClient.request in order to get the proper Content-Type header. Would you be open to only setting that header if one does not exist in the headers= kwarg?

Happy to make that change, just wanted to confirm my design beforehand.

twm commented 3 years ago

That sounds reasonable to me. I can see other use cases, e.g. using the json keyword argument with a JSON Patch content type.