You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If you add a header with no content as in 'Accept:' (no data on the right side of the colon), the internally used header is disabled/removed. With this option you can add new headers, replace internal headers and remove internal headers. To add a header with no content (nothing to the right side of the colon), use the form 'name;' (note the ending semicolon).
But this will not happen. For example
{'Content-Type': ''}
In the request it becomes like
Content-Type:
Headers like
{'Content-Type': None}
Produces a huge number of errors(since you always expect a string)
If I removing the header completely the default Curl header appearing(As it should be according to the documentation).
Content-Type: application/x-www-form-urlencoded
suggest that the correct behavior for {'Some-Header': None} is remove headers ( set Some-Header: for curl), and for {'Some-Header': ''} is set Some-Header; (note the ending semicolon).
The text was updated successfully, but these errors were encountered:
Agree. Need a way to remove default headers by setting them to None.
Here's another example:
curl_cffi by default sends Sec-Fetch-User header with each request: Sec-Fetch-User: ?1
This header signals that the request was initiated by user. According to the documentation, it can only have one value - "?1". Otherwise, this header should not be sent. For example, when requesting images or styles. Removing this header is necessary to pretend to be a browser.
According CURL doc https://curl.se/libcurl/c/CURLOPT_HTTPHEADER.html
All headers with empty value should be removed, without replacing with default headers
If you add a header with no content as in 'Accept:' (no data on the right side of the colon), the internally used header is disabled/removed. With this option you can add new headers, replace internal headers and remove internal headers. To add a header with no content (nothing to the right side of the colon), use the form 'name;' (note the ending semicolon).
But this will not happen. For example
{'Content-Type': ''}
In the request it becomes like
Content-Type:
Headers like
{'Content-Type': None}
Produces a huge number of errors(since you always expect a string)
If I removing the header completely the default Curl header appearing(As it should be according to the documentation).
Content-Type: application/x-www-form-urlencoded
suggest that the correct behavior for
{'Some-Header': None}
is remove headers ( setSome-Header:
for curl), and for{'Some-Header': ''}
is setSome-Header;
(note the ending semicolon).The text was updated successfully, but these errors were encountered: