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
Describe the bug
I can't send authorizaton or any kind of headers to websites with curl module in pypath if the headers are defined as dictionary.
To Reproduce
Steps to reproduce the behavior:
Define headers as dictionary
Transmit them, for example use them to authorize in an API.
Expected behavior
I wanted it (_req_headers_list) to turn dictionary headers to list objects.
Traceback
I don't have a traceback but I see that no headers are transmitted. If I turn them into list object everything works fine. After the initial connection, it doesn't matter at all since curl is using cached data. The problem lies within the _req_headers_list module. I suspect the self.req_headers = self.req_headers or [] line but I'm not quite sure since it looks logically okay.
Desktop (please complete the following information):
OS: Linux 5.15.54-1-lts x86_64
Python version: Python 3.10.5
The text was updated successfully, but these errors were encountered:
Just tried the function on a jupyter notebook and it worked as it should. I'm not sure whether it's a problem about Curl class or me problem. Curl class still can't understand dictionary headers though.
Reading the code it seems to me both lists or dicts should work fine, i.e. the headers can be passed either as ["Accept-encoding: gzip, deflate"] or {"Accept-encoding": "gzip, deflate"}. If you have different experience, please send a specific example.
Well, the latter just didn't work at the time while the former worked quite wells. I read the code too but couldn't figure out why. Will try it when I can.
Describe the bug
I can't send authorizaton or any kind of headers to websites with curl module in pypath if the headers are defined as dictionary.
To Reproduce
Steps to reproduce the behavior:
Expected behavior
I wanted it (
_req_headers_list
) to turn dictionary headers to list objects.Traceback
I don't have a traceback but I see that no headers are transmitted. If I turn them into list object everything works fine. After the initial connection, it doesn't matter at all since curl is using cached data. The problem lies within the
_req_headers_list
module. I suspect theself.req_headers = self.req_headers or []
line but I'm not quite sure since it looks logically okay.Desktop (please complete the following information):
The text was updated successfully, but these errors were encountered: