islamic-network / api.alquran.cloud

The AlQuran.Cloud API - https://alquran.cloud/api
GNU General Public License v3.0
229 stars 42 forks source link

Cors origin when call api in localhost #30

Closed justirva09 closed 4 years ago

justirva09 commented 4 years ago

Hi, i using this Quran API for my web app development. the API get a CORS on network.

how to resolve this problem ?

SSSS

meezaan commented 4 years ago

Setup an entry in your local host file (/etc/host on any Linux machine) with a domain that maps to 127.0.0.1.

justirva09 commented 4 years ago

I use windows and I am implementing it using ReactJS with axios to get data from api. Will I have this problem if I have uploaded it to the server?

meezaan commented 4 years ago

Actually looking at the error, the problem is with your request. It's quite clear on the problem. Don't send the content-type header in your request and it should work just fine.

justirva09 commented 4 years ago

oke, thanks brother :)