Announcements
This site is in read only until July 22 as we migrate to a new platform; refer to this community post for more details.
Get hands-on experience with 20+ free Google Cloud products and $300 in free credit for new customers.

Why can't I set request headers to apigee proxy from a locally running angular app

Hi,

I have a simple angular app and I am trying to call my apigee proxy but it fails at verifying the api key. When I trace it, I realize my request headers were not being set.. Thinking I'm doing something wrong in setting headers from my client angular app, I tried setting headers for a non-apigee url. I did some research and looks like its some CORS issue. and i followed the steps mentioned.. but still no luck

The error I get is

XMLHttpRequest cannot load <apigee-proxy-url>. 
Response to preflight request doesn't pass access control check: No 'Access-Control-Allow-Origin' header is present on the requested resource. 
Origin 'http://localhost:8000' is therefore not allowed access.

The response had HTTP status code 401.

1 8 3,622
8 REPLIES 8