Open Tagge opened 4 months ago
Did you use the default_headers=False
option to disable built-in headers? They may interfere with your custom headers.
Sadly it doesn't change it. Host is still being moved to the very top, and Accept is added automatically.
I see. Host
being reordered is a known issue. Are there any other headers that jump around unexpectedly? except for Host
and Accept
.
I will update the progress in this issue.
In my case, Accept-Encoding also has been swapped with Connection. I think it's mostly those ones.
Is your feature request related to a problem? Please describe. In some special instances, I have to be able to specify the order of my HTTP headers. Usually, with the original requests library, I would be able to do that by passing it an instance of Collections.OrderedDict containing my headers in the order desired. I have tried this approach with curl_cffi, and it doesn't seem to conserve the order of the headers no matter what I do. This is a useful feature as an order can sometimes be imposed by the webserver.
Describe the solution you'd like Like for the requests library, it would be ideal to be able to pass an OrderedDict object that would automatically trigger the ordering of the headers.
Describe alternatives you've considered Sadly, in those instances, I am forced to use something else.