KLTR
KLTR

Reputation: 1344

API call work on nodejs but not on angular / client side js

I'm trying to access STREAK Api using angular. When i'm sending the request to Streak i'm getting a CORS Policy error but when trying to access the same request using Node.js i'm getting the response.

So my question is, why is that happening? both the client and the server are hosted on localhost

Upvotes: 0

Views: 139

Answers (1)

pachonjcl
pachonjcl

Reputation: 741

For security reasons, browsers restrict cross-origin HTTP requests initiated from scripts.

This doesn't have anything to do with angular or any other javascript framework.

You can read more about CORS here

Upvotes: 1

Related Questions