[ https://jira.fiware.org/browse/HELP-19269?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Fernando Lopez reassigned HELP-19269: ------------------------------------- Assignee: Stefan Wiedemann > [fiware-stackoverflow] JS can't receive JSON data from orion-ld broker, a CORS related issue occurred > --------------------------------------------------------------------------------------------------------- > > Key: HELP-19269 > URL: https://jira.fiware.org/browse/HELP-19269 > Project: Help-Desk > Issue Type: Monitor > Components: FIWARE-TECH-HELP > Reporter: Backlog Manager > Assignee: Stefan Wiedemann > Labels: cors, fiware, javascript, json > > Created question in FIWARE Q/A platform on 27-02-2022 at 08:02 > {color: red}Please, ANSWER this question AT{color} https://stackoverflow.com/questions/71283416/js-cant-receive-json-data-from-orion-ld-broker-a-cors-related-issue-occurred > +Question:+ > JS can't receive JSON data from orion-ld broker, a CORS related issue occurred > +Description:+ > I use orion-ld context brocker > { > "orionld version": "post-v1.0.0", > "orion version": "1.15.0-next", > "uptime": "0 d, 0 h, 25 m, 17 s", > "git_hash": "nogitversion", > "compile_time": "Wed Jan 26 15:58:47 UTC 2022", > "compiled_by": "root", > "compiled_in": "", > "release_date": "Wed Jan 26 15:58:47 UTC 2022", > "doc": "https://fiware-orion.readthedocs.org/en/master/" > } > If I try to request JSON data in an HTML file via JS like > var myRequest = new XMLHttpRequest(); > myRequest.open("GET", "http://192.168.0.18:1028/ngsi-ld/v1/entities/urn:ngsi-ld:OffStreetParking:XXX_102700") ; > myRequest.setRequestHeader("Accept", "application/ld+json") > myRequest.onload = function () { > console.log(myRequest.responseText); > }; > myRequest.send(); > I got a error: "Access to XMLHttpRequest at 'http://192.168.0.18:1028/ngsi-ld/v1/entities/urn:ngsi-ld:OffStreetParking:XXX_102700' from origin 'http://192.168.0.18' has been blocked by CORS policy: No 'Access-Control-Allow-Origin' header is present on the requested resource." > If I login to the docker container console and check the variable ORIONLD_CORS_ALLOWED_ORIGIN, it contains the necessary value "__ALL". > What could be wrong here? -- This message was sent by Atlassian JIRA (v6.4.1#64016)
You can get more information about our cookies and privacy policies clicking on the following links: Privacy policy Cookies policy