0

调用 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工作正常。

使用 chrome 单击此链接会出现错误:https ://upload.twitter.com/1.1/media/uplaod.json

是推特,不是我...

4

1 回答 1

0

您似乎调用了错误的 URL - 只是输入错误。

反而

https://upload.twitter.com/1.1/media/uplaod.json

你应该打电话:

https://upload.twitter.com/1.1/media/upload.json
于 2016-02-05T16:00:31.163 回答