这个错误错误是如此普遍,我发现了几个点击此错误。但是,找不到解决我的问题。错误请求(400),同时试图访问请求使用REST API在Python
我想用消耗请求模块Python中的REST API(不公开提供者之一)。但是,API消耗的规范指示我使用URI调用POST方法,Content-type = 'application/xml'
和主体"<authCommand><userID> </userID><password> </password></authCommand>"
。
我在使用Python请求试过这样: r1 = requests.post('https://abc.360.net/rest/auth/1/login.xml',data= None, auth=('[email protected]','*********'), headers = {'content-type':'application/xml'})
当我运行此,我收到一个坏请求错误。
这是正确的方法吗?为什么我收到此错误?
你能提供一个API文档的链接吗?您很可能没有正确遵循API的要求。 – Anorov