Facebook API 错误是怎么回事:无法解析为日期或时间
我收到了群组墙帖子,在 json 响应的末尾就好了,我收到了分页对象 当我获取先前的值并尝试 http 请求它时:
https://graph.facebook.com/175923872448029/feed?access_token=**********13c0fd29b9-557002013|N-oGZ6q2sNDNg1I3leS0v9U-TDw&limit=25&since=2011-01-25T1100253A3400253A2100252B0000
im getting this error :
{
"error": {
"type": "InvalidArgumentException",
"message": "Could not parse '2011-01-25T1100253A3400253A2100252B0000' into a date or time."
}
}
日期有什么问题?
Im getting group wall posts , just fine in the end of the json response , im getting the paging object
when i take the previous value and try to http request it:
https://graph.facebook.com/175923872448029/feed?access_token=**********13c0fd29b9-557002013|N-oGZ6q2sNDNg1I3leS0v9U-TDw&limit=25&since=2011-01-25T1100253A3400253A2100252B0000
im getting this error :
{
"error": {
"type": "InvalidArgumentException",
"message": "Could not parse '2011-01-25T1100253A3400253A2100252B0000' into a date or time."
}
}
what is wrong with the date ?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
当您在浏览器中打开 https://graph.facebook.com/175923872448029/feed 时,您你会注意到分页链接由 utf 数字代码组成,在使用它们之前必须对其进行解码[编辑]。
然而,当我使用 PHP SDK 请求相同的对象时,我得到了一个可以正常工作的编码 URL。
我相信,这个行为的原因在这篇文章中得到了解释。
总之,您必须检查返回的字符串是什么样子并对其进行充分解码,然后再继续。
when you open https://graph.facebook.com/175923872448029/feed in your browser you'll notice that the paging link consists of utf numeric codes which have to be decoded prior to using them [edit].
However, when I requested the same object using the PHP SDK I got an encoded URL which works fine.
The reason for that behaviour is explained, I believe, in this post.
In summary, you have to check what the returned string looks like and decode it adequately before you proceed.