Answer the question
In order to leave comments, you need to log in
Error 418: I'm a teapot when connecting to the KazanExpress API. What is the reason?
I'm trying to get data about the store using the KazanExpress API in this way:
headers = {
'user-agent': 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/90.0.4430.93 Safari/537.36',
'Authorization': 'Basic НЕСКАЖУ'
}
login = requests.post('https://api.kazanexpress.ru/api/oauth/token?grant_type=password&username=НЕСКАЖУ&password=НЕСКАЖУ, headers=headers)
print(login.json())
headers.update({
'Authorization': 'Bearer ' + login.json()['access_token']
})
shops = requests.get('https://api.kazanexpress.ru/api/seller/shop/', headers=headers)
print(shops.json())
{'timestamp': 1621067445165, 'status': 418, 'error': "I'm a teapot", 'message': "I'm a teapot", 'path': '/api/seller/shop/'}
Answer the question
In order to leave comments, you need to log in
Put any running application and set up fiddler then watch the application traffic and modify yours
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question