Answer the question
In order to leave comments, you need to log in
yandex.locator API "Specify xml or json param" error, how to fix?
I'm trying to generate a request in accordance with https://tech.yandex.ru/locator/doc/dg/api/capture-... in python using the requests docs.python-requests.org/en/latest/ module. I tried everything, I always get an error: Specify xml or json param.
Has anyone experienced something similar? What could be the problem?
Errors in syntax and application of the requests module are excluded.
Code:
Error:
Answer the question
In order to leave comments, you need to log in
It says "Specify xml or json param"
Add the response data format to the request.
Also scratched my head. It turns out everything is very simple.
requests.post(url=url, headers=headers, data="json=" + data)
Roman Kitaev I'm trying, I specify the format in the headers. Here is the code:
here is the message:
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question