调用twitter api v1.1端点时:
https://upload.twitter.com/1.1/media/uplaod.json
我收到以下错误:
message: The Twitter REST API v1 is no longer active. Please migrate to API
v1.1. https://dev.twitter.com/docs/api/1.1/overview.
code: 64
通过带有requests-oauthlib的python-requests发出的完整请求:
POST https://upload.twitter.com/1.1/media/uplaod.json
Content-Length: 25566
Accept-Encoding: gzip, deflate
Accept: */*
User-Agent: python-requests/2.4.3 CPython/2.7.2 Windows/post2008Server
Connection: keep-alive
Content-Type: multipart/form-data; boundary=57ae35dd03714226a367e5a8268f9c5b
Authorization: OAuth oauth_nonce="<censored>", oauth_timestamp="1424492683", oauth_version="1.0", oauth_signature_method="HMAC-SHA1", oauth_consumer_key="<censored>", oauth_token="<censored>", oauth_signature="<censored>"
--57ae35dd03714226a367e5a8268f9c5b
Content-Disposition: form-data; name="media[]"; filename="4725ec4acf23d7a9a7fd92337f2b4713f746c7df.jpg"
Content-Type: application/octet-stream
<censored...binary...data>
--57ae35dd03714226a367e5a8268f9c5b--
今天早些时候工作。有人可以确认这是推特问题,我不会生气吗?
似乎其他端点如https://api.twitter.com/1.1/statuses/home_timeline.json正常工作。
点击此链接并显示错误:https://upload.twitter.com/1.1/media/uplaod.json
这是Twitter,不是我......
答案 0 :(得分:0)
您似乎在调用错误的网址 - 只需输入错误。
相反
https://upload.twitter.com/1.1/media/uplaod.json
你应该致电:
https://upload.twitter.com/1.1/media/upload.json