How to curl -k -H with python requests -
i have curl command:
curl -k -h "x-apitokenid: 11111111-2222-...." https://staging.mycompany.com/v1/users.json
and works ok. when translate requests:
r=requests.get("https://staging.mycompany.com/v1/user.json",headers={'authourization':'tok:11111111-2222-....'})
it says "unauthorized access resource." how correct this?
add x-apitokenid
headers
(same curl -h) , verify=false
ignore verifying ssl cert (same curl -k):
r=requests.get("https://staging.mycompany.com/v1/user.json",headers={'x-apitokenid':'11111111-2222-....'}, verify=false)
Comments
Post a Comment