Skip to content

Commit

Permalink
Set content-type to application/octet-stream for bytes and strs, close
Browse files Browse the repository at this point in the history
  • Loading branch information
lexiforest committed Sep 24, 2024
1 parent 38a91f2 commit eea70a1
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions curl_cffi/requests/session.py
Original file line number Diff line number Diff line change
Expand Up @@ -452,6 +452,8 @@ def _set_curl_options(
_update_header_line(header_lines, "Content-Type", "application/json")
if isinstance(data, dict) and method != "POST":
_update_header_line(header_lines, "Content-Type", "application/x-www-form-urlencoded")
if isinstance(data, (str, bytes)):
_update_header_line(header_lines, "Content-Type", "application/octet-stream")

# Never send `Expect` header.
_update_header_line(header_lines, "Expect", "")
Expand Down

0 comments on commit eea70a1

Please sign in to comment.