Angular 2 prevent x-xsrf-token to be added on single http request -


i have web app need make request webservice outside of page.

this request made within restricted page, , because of this, have x-xsrf-token set, autenticate user on webpage. working.

but need make request webservice outside of page, not accept x-xsrf-token, given me error:

xmlhttprequest cannot load "https://webservice-here..." request header field x-xsrf-token not allowed access-control-allow-headers in preflight response.

but since i'm inside restricted area, don't know how solve issue... http service:

apicustom(url: string) {     let headers = new headers();     headers.delete('x-xsrf-token');      return this._http.get(url, {         headers: headers     }).map(response => response.json()).do(data => {         return data;     }).catch(this.handleerrors); } 

i tried delete x-xsrf-token (also tried xsrf-token) manually, didn't worked.

is there way solve this?


Comments

Popular posts from this blog

php - Vagrant up error - Uncaught Reflection Exception: Class DOMDocument does not exist -

vue.js - Create hooks for automated testing -

Add new key value to json node in java -