originally posted in:BungieNetPlatform
View Entire Topic
Having trouble with JavaScript requests and CORS in browsers?
Fear no more, simply replace http://www.bungie.net/platform with http://bungie-platform.herokuapp.com/proxy.
The API Proxy works on node and simply proxies your request to the bungie.net/platform while removing the CORS headers. It also forwards cookies (hooray!).
[b]API Explorer[/b]
If you want to simply look what is available for API Endpoints you don't have to write your own client. I tried parsing the endpoints file and with a bit of code the API Explorer was alive: http://bungie-platform.herokuapp.com/api/explorer. I still need to map out some things so one knows what to actually put into the generated fields BUT right now I think it already works pretty well.
Cheers and have fun o/
Sargo
-
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.