david
(David Taylor)
10 Agosto 2021, 10:12am
2
Devi inviare Api-Key e Api-Username come intestazioni separate, non nell’intestazione Authorization. Una soluzione simile a questa dovrebbe funzionare meglio:
header = CaseInsensitiveDict()
header["Api-Key"] = 'longapikey'
header["Api-Username"] = 'myusername'
Sembra lo stesso problema del tuo argomento precedente:
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…