Twitter API get tweets - returns CORS origin blocked

让人想犯罪 __ 提交于 2019-12-02 08:29:04

The reason why you are getting this error is because your making the request through the browser. Browsers don't allow cross domain requests because like @allenru mentioned in the comments below: Servers need to response according to the CORS spec so the browser can proceed with the request.

You can learn more about it here : https://developer.mozilla.org/en-US/docs/Web/HTTP/Access_control_CORS

The proper way to fetch tweets would be making a call to the server and have the server fetch tweets for you.

This also seems like a buggy call.
https://api.twitter.com/1.1/search/tweets.json?f=tweets&q=%23shruthirajoli&src=typd?get=%5Bobject+Object%5D. Its not normal to have [object + object] in requests. It seems like an object that was not stringified.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!