What I’m trying to do:
Use the anvil requests module to query data from an API
What I’ve tried and what’s not working:
I can connect to the API but I cannot get authenticated, despite having a username/password that I know is correct & working!
Code Sample:
# code snippet
resultQuery = a.request(url.format(query),method="GET",username=self.api_key,password="")
Recieving : HttpError: 401
but when I run the code from my terminal
resultQuery = requests.get(url.format(query),auth=(self.key,''),timeout=5)
it works fine!!
Clone link:
share a copy of your app