Closed vevv closed 1 month ago
Describe the bug curl_cffi still messes with Content-Type headers. Even If I set Content-Type to "text/plain" manually, and send a POST request with string data, it will be encoded with "application/octet-stream".
To Reproduce
from curl_cffi import requests resp = requests.post(url="https://httpbin.dev/headers", data="test", headers={"Content-Type": "text/plain"}) print(resp.json()["headers"]["Content-Type"])
Expected behavior User-provided Content-Type headers are expected.
Versions
Additional Context Unrelated, but this part is incorrect:
if isinstance(data, dict) and method != "POST": _update_header_line(header_lines, "Content-Type", "application/x-www-form-urlencoded")
This should run on POST as well, it's usually used with POST or PUT.
Also, "text/plain" is probably more appropriate for strings.
Duplicate of #395, fixed in v0.7.3
Describe the bug curl_cffi still messes with Content-Type headers. Even If I set Content-Type to "text/plain" manually, and send a POST request with string data, it will be encoded with "application/octet-stream".
To Reproduce
Expected behavior User-provided Content-Type headers are expected.
Versions
Additional Context Unrelated, but this part is incorrect:
This should run on POST as well, it's usually used with POST or PUT.
Also, "text/plain" is probably more appropriate for strings.