diff --git a/curl_cffi/requests/session.py b/curl_cffi/requests/session.py index 2458c6a..2108c5b 100644 --- a/curl_cffi/requests/session.py +++ b/curl_cffi/requests/session.py @@ -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", "")