originally posted in:BungieNetPlatform
Hey, I was wondering if you could give me a hand with this. I'm trying to use the herokuapp to overcome the CORS issue, but I'm getting the following message:
[quote]XMLHttpRequest cannot load http://bungie-platform.herokuapp.com/proxy/User/SearchUsers/?q=FraserBaws. Request header field X-API-Key is not allowed by Access-Control-Allow-Headers in preflight response.[/quote]
I'm using the following jQuery AJAX call:
[quote] $.ajax({
type: 'GET',
beforeSend: function (request) {
request.setRequestHeader("X-API-Key", apiKey);
},
url: 'http://bungie-platform.herokuapp.com/proxy/User/SearchUsers/?q=FraserBaws',
success: function( data ) {
response(data.Response);
}
});[/quote]
Any idea why I may be getting this message? Any help is greatly appreciated.
English
-
Hey Fraser, I don't think that heroku proxy app takes API key as a param. It was made before api keys were required so it's possible it was never updated. I can help you if you're running an angular app
-
Ahh, I see. Thanks for the info. I initially wanted to create my app purely in javascript, but to overcome the CORS issue I've decided to just use some C# code. Angular looks really cool though, will definitely be checking it out soon. Thanks!