GET Twitter的/用户/显示/返回错误:400错误:404(AJAX)
林制造ajax
调用看起来像这样:GET Twitter的/用户/显示/返回错误:400错误:404(AJAX)
$.ajax({
type:"GET",
dataType: "jsonp",
url:"https://api.twitter.com/1.1/users/show.json?user_id="+twitterId,
contentType:"application/json",
success:apiSuccessCallback,
error:apiFailCallback
});
和IM包括jsonp
作为一种解决方法跨域的问题。不过,我收到以下错误:
Failed to load resource: the server responded with a status of 404 (Not Found)
和
Failed to load resource: the server responded with a status of 400 (Bad Request)
如果你想知道我的success
是一个简单的警告声明,我error
是一样的。
任何人有任何建议吗?
我会尝试包括suppress_response_codes
https://dev.twitter.com/docs/error-codes-responses
$.ajax({
type:"GET",
dataType: "jsonp",
data: {
suppress_response_codes: true
},
url:"https://api.twitter.com/1.1/users/show.json?user_id="+twitterId,
contentType:"application/json",
success:apiSuccessCallback,
error:apiFailCallback
});
从文档 -
If this parameter is present, all responses will be returned with a 200 OK status code - even errors. This parameter exists to accommodate Flash and JavaScript applications running in browsers that intercept all non-200 responses.
我不认为它的问题与反应被压制...是否因为我需要验证此API调用? – 2013-04-26 01:38:36
这可能是问题,对不起,我认为你已通过身份验证。 – 2013-04-26 01:59:11
你是对的......我现在正在进行认证过程......无论如何 – 2013-04-26 03:04:43
是你让从'https'请求域? – 2013-04-26 01:05:33
我不是在https中,但我尝试了https,并且得到了相同的错误 – 2013-04-26 01:10:18
是否调用了'apiFailCallback'? – 2013-04-26 01:16:40