david
(David Taylor)
10 Agosto, 2021 10:12
2
Necesitas enviar la Api-Key y la Api-Username como encabezados independientes, no dentro del encabezado Authorization. Algo como esto debería funcionar mejor:
header = CaseInsensitiveDict()
header["Api-Key"] = 'longapikey'
header["Api-Username"] = 'myusername'
Esto parece ser el mismo problema que en tu tema anterior:
You are right, that’s something the tool I am using to test the API is doing and it works and that’s a problem on itself apparently:
header1 = CaseInsensitiveDict()
header1["Authorization"] = '{"api-key": "longapikey", "api-username": "myusername"}'
header2 = {"api-key": "longapikey", "api-username": "myusername"}
r = requests.get(url, headers= HEADER)
When HEADER == header1, it works, when == header2, I get:
{"errors":["You are not permitted to view the requested resource. The API username…