You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Any explicit Content-Type header should take precedence over the encoding default. #620
changed the title [-]httpx replace Content-Type[/-][+]Any explicit `Content-Type` header should take precedence over the encoding default.[/+]on Dec 9, 2019
Activity
florimondmanca commentedon Dec 9, 2019
Hi @daxartio,
What exact use case are you facing that requires passing
json=...while setting aContent-Typeto something else thanapplication/json?As a workaround, using
data=...should allow you to set theContent-Typeyourself:lovelydinosaur commentedon Dec 9, 2019
Sure thing.
We shouold probably change this...
httpx/httpx/models.py
Line 627 in eba29da
To
self.headers.setdefault('Content-Type', content_type), so that if the user has explicitly set a Content-Type header that takes precedence.(Or else leave that line as it is an use
if content_type and 'Content-Type' not in self.headersin the previous line.)Pull requests accepted.
[-]httpx replace Content-Type[/-][+]Any explicit `Content-Type` header should take precedence over the encoding default.[/+]