szdc / tiktok-api

Unofficial API wrapper for TikTok
MIT License
1.27k stars 278 forks source link

http://localhost:3000' has been blocked by CORS policy #139

Closed ajith-ab closed 4 years ago

ajith-ab commented 4 years ago

I have been installed in react then I will get

http://localhost:3000' has been blocked by CORS policy

xxMrPHDxx commented 4 years ago

The request you made sent header Origin: localhost to the server which will be block because the server only allows specific origin to access the api. As the ajax/fetch request doesn't allow header Origin to be supplied manually, you may want to take a look at using cors-everywhere.herokuapp.com/{{API_LINK_HERE}}. Wrap your request using that url and you need to specify either the Origin or X-Requested-With header. See the cors-everywhere API details here

szdc commented 4 years ago

This library doesn't make requests to localhost. If you open an issue, please provide a stack trace and/or steps to reproduce or I can't help you.