Uploaded image for project: 'Help-Desk'
  1. Help-Desk
  2. HELP-13450

FIWARE.Question.Tech.Fiware error: Access-Control-Allow-Origin.

    Details

      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 (

      {'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

        Activity

        fla Fernando Lopez made changes -
        Fix Version/s 2021 [ 12600 ]
        fla Fernando Lopez made changes -
        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
        backlogmanager Backlog Manager made changes -
        Summary [fiware-stackoverflow] Fiware error: Access-Control-Allow-Origin FIWARE.Question.Tech.Fiware error: Access-Control-Allow-Origin.
        backlogmanager Backlog Manager made changes -
        Resolution Done [ 10000 ]
        Status Answered [ 10104 ] Closed [ 6 ]
        backlogmanager Backlog Manager made changes -
        Status In Progress [ 3 ] Answered [ 10104 ]
        backlogmanager Backlog Manager made changes -
        Status Open [ 1 ] In Progress [ 3 ]
        jmcantera Jose Manuel Cantera made changes -
        Assignee Jose Manuel Cantera [ jmcantera ] Karaboga, Burak [ burak ]
        veronika Veronika Vlnkova made changes -
        Assignee Jose Manuel Cantera [ jmcantera ]
        backlogmanager Backlog Manager made changes -
        Field Original Value New Value
        Component/s FIWARE-TECH-HELP [ 10278 ]
        backlogmanager Backlog Manager created issue -

          People

          • Assignee:
            burak Karaboga, Burak
            Reporter:
            backlogmanager Backlog Manager
          • Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: