Details
- 
        Type:Monitor 
- 
        Status: Closed
- 
            Priority: Major Major
- 
            Resolution: Done
- 
            Affects Version/s: None
- 
            Fix Version/s: 2021
- 
            Component/s: FIWARE-TECH-HELP
- 
            Labels:
- 
                        HD-Enabler:Orion
Description
Created question in FIWARE Q/A platform on 30-01-2018 at 14:01
Please, ANSWER this question AT https://stackoverflow.com/questions/48523162/fiware-error-access-control-allow-origin
Question:
Fiware error: Access-Control-Allow-Origin
Description:
I'm making a call to the contextBroker and it gives me this error.
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:4200' is therefore not allowed access. The response had HTTP status code 405.
From postman or from freeboard I do not get any of this.
  getContextBroker(){
    console.log("Consumimos el servicio getContextBroker");
    let headers = new Headers (
);
    let options = new RequestOptions (
);
    return this._http.get(this.urlcontextBrokers, 
).map(res => res.json());
  }
}
how can I solve that?
I've tried adding: 'Access-Control-Allow-Origin': '*'
But it still does not work
Activity
| Field | Original Value | New Value | 
|---|---|---|
| Component/s | FIWARE-TECH-HELP [ 10278 ] | 
| Assignee | Jose Manuel Cantera [ jmcantera ] | 
| Assignee | Jose Manuel Cantera [ jmcantera ] | Karaboga, Burak [ burak ] | 
| Status | Open [ 1 ] | In Progress [ 3 ] | 
| Status | In Progress [ 3 ] | Answered [ 10104 ] | 
| Resolution | Done [ 10000 ] | |
| Status | Answered [ 10104 ] | Closed [ 6 ] | 
| Summary | [fiware-stackoverflow] Fiware error: Access-Control-Allow-Origin | FIWARE.Question.Tech.Fiware error: Access-Control-Allow-Origin. | 
| HD-Enabler | Orion [ 10875 ] | |
| Description | Created question in FIWARE Q/A platform on 30-01-2018 at 14:01 {color: red}Please, ANSWER this question AT{color} https://stackoverflow.com/questions/48523162/fiware-error-access-control-allow-origin +Question:+ Fiware error: Access-Control-Allow-Origin +Description:+ I'm making a call to the contextBroker and it gives me this error. 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:4200' is therefore not allowed access. The response had HTTP status code 405. From postman or from freeboard I do not get any of this. getContextBroker(){ console.log("Consumimos el servicio getContextBroker"); let headers = new Headers ({'Accept': 'application/json', 'Fiware-Service': 'x', 'Fiware-ServicePath': '/x', 'Access-Control-Allow-Origin': '*'}); let options = new RequestOptions ({headers : headers}); return this._http.get(this.urlcontextBrokers, {headers : headers}).map(res => res.json()); } } how can I solve that? I've tried adding: 'Access-Control-Allow-Origin': '*' But it still does not work | Created question in FIWARE Q/A platform on 30-01-2018 at 14:01 {color: red}Please, ANSWER this question AT{color} https://stackoverflow.com/questions/48523162/fiware-error-access-control-allow-origin +Question:+ Fiware error: Access-Control-Allow-Origin +Description:+ I'm making a call to the contextBroker and it gives me this error. 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:4200' is therefore not allowed access. The response had HTTP status code 405. From postman or from freeboard I do not get any of this. getContextBroker(){ console.log("Consumimos el servicio getContextBroker"); let headers = new Headers ({'Accept': 'application/json', 'Fiware-Service': 'x', 'Fiware-ServicePath': '/x', 'Access-Control-Allow-Origin': '*'}); let options = new RequestOptions ({headers : headers}); return this._http.get(this.urlcontextBrokers, {headers : headers}).map(res => res.json()); } } how can I solve that? I've tried adding: 'Access-Control-Allow-Origin': '*' But it still does not work | 
| Fix Version/s | 2021 [ 12600 ] | 
| Transition | Time In Source Status | Execution Times | Last Executer | Last Execution Date | |||||
|---|---|---|---|---|---|---|---|---|---|
| 
 | 1d 2h 58m | 1 | Backlog Manager | 31/Jan/18 6:05 PM | |||||
| 
 | 3h | 1 | Backlog Manager | 31/Jan/18 9:05 PM | |||||
| 
 | 3h | 1 | Backlog Manager | 01/Feb/18 12:05 AM | 
 
	 
		                 
	 
	 
	
2018-01-30 15:07|CREATED monitor | # answers= 0, accepted answer= False