Rest API works in Google Rest Client but in AngularJS their is a CORS issue. Why is that?
1 Answer
CORS doesn't apply to the client because it isn't try to do the request from another website - it's doing it from your computer. But when you do it on your site using AngularJS - then you encounter the CORS issue.
7 Comments
Rethabile
How is Google Rest API sending their request to avoid the CORS issue? I've read so many different ways to try and solve the issue but not a standard one so I tried it in Goggle Rest API and that's when i saw it worked for them.
dmgig
Sorry, just to make sure I'm on the right page with you - the Google REST client you are using is the Chrome Extension? Or something else?
Sergio Marron
Chrome Extensions are allowed to send and received data from remote servers. developer.chrome.com/extensions/xhr
Rethabile
Gotcha, that makes me feel a lot better. Their needs to be a standard practice to this CORS issue because it waste a lot of development time.
dmgig
Well - forgive me if I'm mistaken but I think maybe you're not quite seeing the difference between using the Chrome extension and trying to do the same call from inside a website. There's a big difference in the sense that CORS is meant to prevent REST calls between websites - but when you use the Chrome extension, you're making a call between your computer and a website (as opposed to two websites).
|