I develop locally on Windows 10 using XAMPP stack.
http://localhost:8003/myFolder/
This is my code:
Code snippet: URL without CORS mechanism
I get the following error: POST https://pos.ls.hereapi.com/positioning/v1/locate?apiKey=Lxj-xbibfpSHLMw1U...blabla net::ERR_ABORTED 400 (Bad Request)
Code snippet: URL with CORS mechanism
I get the following error: POST http://host/path?CORSH=%7B%22Content-Type%22%3A%22application%2Fvnd.here.layerObjectList%2Bjson%3B%20charset%3Dutf-8%22%2C%22Accept%22%3A%22application%2Fjson%3B%20charset%3DUTF-8%22%2C%22GroupId%22%3A%22FGx1AWaAzKOo0imNkLmf%22%2C%22AuthServiceId%22%3A%22here_app%22%2C%22Auth-Identifier%22%3A%22Ykv6MmZ03OJtiFD4R7Ht%22%2C%22Auth-Secret%22%3A%22AXqUNisVW46XJs9_pxuzOzneKlYPrY5X_blablabla net::ERR_NAME_NOT_RESOLVED
I have the same problem:
url = 'https://geocode.search.hereapi.com/v1/geocode?q=Eichholz 27 ,+ 20459 ,+ Hamburg ,+ D&apiKey=yYoMr6vEReqc_sI0HAPMqIu3fYJdGcRsBR5t-xxxxxx' ;
$.ajax({ crossDomain: true, type : 'get', headers: { 'Access-Control-Allow-Origin': '*' }, url : url , contentType: "application/json; charset=utf-8", dataType : 'json', jsonCallback : 'getJson', async : false, success : function(data) { $.each(data, function(counter, daten) {
Quellübergreifende (Cross-Origin) Anfrage blockiert: Die Gleiche-Quelle-Regel verbietet das Lesen der externen Ressource auf https://geocode.search.hereapi.com/v1/geocode?q=Winterfeldtstrasse%2079,+%2010781%20,+%20Berlin%20,+%20GERMANY&apiKey=yYoMr6vEReqc_sI0HAPMqIu3fYJdGcRsBR5t-xxxxx. (Grund: CORS-Anschlag schlug fehl)