Twitter v1.1:400 错误请求 [英] Twitter v1.1: 400 Bad request

查看:36
本文介绍了Twitter v1.1:400 错误请求的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在使用新的 Twitter API 时遇到问题:v1.0 可以正常工作,但如果我将 URL 更改为 v1.1,我总是收到错误400 Bad request"(在 Firebug 中可见).

I have problems with the new Twitter API: v1.0 is working without problems, but if I change the URL to v1.1 I get all the time a error "400 Bad request" (seen with Firebug).

示例:

https://api.twitter.com/1/statuses/user_timeline.json?screen_name=twitterapi

这就像一个魅力,一切正常.只需将 URL 更改为 .../1.1/...,我就会收到一个错误的请求错误,甚至是 JSON 错误响应甚至一些内容.

This is working like a charm, everything works as excepted. Simply changing the URL to .../1.1/... and I get a Bad request error and even to JSON error response or even some content at all.

https://api.twitter.com/1.1/statuses/user_timeline.json?screen_name=twitterapi

注意:这不可能是速率限制,因为我是第一次访问该 URL.

Note: It couldn't be a rate limitation, because I accessed the URL the first time ever.

推荐答案

https://api.twitter.com/1.1/statuses/user_timeline.json?screen_name=twitterapi 将我重定向到 https://api.twitter.com/1/statuses/user_timeline.json?screen_name=twitterapi

看起来 1.11

UPD: 看起来这是一个费率限制(因为 1.1 链接在 2 小时前对我有用).即使您是第一次点击 API 页面,您的一些应用(桌面或移动)也可以使用 API 方法.

UPD: Looks like this is a rate limit (as 1.1 link worked for me 2 hours ago). Even if you hit API page for the first time, some of your apps (descktop or mobile) could use API methods.

UPD2:1.1 中 400 Bad request 意味着您没有自动授权 (https://dev.twitter.com/docs/error-codes-responseshttps://dev.twitter.com/docs/auth/oauth#user-context).所以你需要获取用户上下文

UPD2: in 1.1 400 Bad request means you are not autorized (https://dev.twitter.com/docs/error-codes-responses, https://dev.twitter.com/docs/auth/oauth#user-context). So you need to get user context

这篇关于Twitter v1.1:400 错误请求的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆