Skip to content
Myr

Allow explicit Content-Type to take precedence (#633)

Before adoption: this commit came in with the history the project adopted, so no landing records it.

authored by Arkie · committed by Tom Christie · parent b847ab0 · Browse files · 1 file+1 added−1 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

1 file+1 added−1 removed

  • other:+1 added−1 removed

1 file+1 added−1 removed

modified:httpx/models.py+1 added-1 removed
622 unmodified lines
623 content, content_type = self.encode_data(data, files, json)624 self.is_streaming = False625 self.content = content626 if content_type:627 self.headers["Content-Type"] = content_type627 self.headers.setdefault("Content-Type", content_type)628 elif isinstance(data, (str, bytes)):629 data = data.encode("utf-8") if isinstance(data, str) else data630 self.is_streaming = False631 self.content = data
550 unmodified lines