]> git.ipfire.org Git - thirdparty/httpx.git/commitdiff
Allow explicit Content-Type to take precedence (#633)
authorArkie <cawkfranchise@gmail.com>
Fri, 13 Dec 2019 10:49:15 +0000 (18:49 +0800)
committerTom Christie <tom@tomchristie.com>
Fri, 13 Dec 2019 10:49:15 +0000 (10:49 +0000)
httpx/models.py

index 4f7e78e976a826a3ad74dd8fd30a39abb67dcd8a..10af37c5323aa38f891bf6870400c6028d0d9f4e 100644 (file)
@@ -624,7 +624,7 @@ class Request:
             self.is_streaming = False
             self.content = content
             if content_type:
-                self.headers["Content-Type"] = content_type
+                self.headers.setdefault("Content-Type", content_type)
         elif isinstance(data, (str, bytes)):
             data = data.encode("utf-8") if isinstance(data, str) else data
             self.is_streaming = False