This is not a CORS issue
endpoint :- ‘http://xyz.com/abc’
Ionic v1 app (WORKS)
$http.defaults.headers.common.Authorization = 'Basic something=';
Angular 2 web app (works)
const headers = new Headers({'Content-Type': 'application/json'});
headers.append('withCredentials','true');
headers.append('Authorization', 'Basic something=');
let options = new RequestOptions({ headers: headers });
this._http.post('endpoint ', formData , options)
Ionic 2 (DOES NOT WORK)
const headers = new Headers({'Content-Type': 'application/json'});
headers.append('withCredentials','true');
headers.append('Authorization', 'Basic something=');
let options = new RequestOptions({ headers: headers });
this._http.post('endpoint ', formData , options)
Ionic 2 try 2 (DOES NOT WORK)
const headers = new Headers({'Content-Type': 'application/json'});
headers.append('withCredentials','true');
headers.append('Authorization', 'Basic something=');
let options = new RequestOptions({ headers: headers,withCredentials: true });
this._http.post('endpoint ', formData , options)
Someone already posted this on stackoverflow :- http://stackoverflow.com/questions/38775587/ionic-2-angular-2-cors-http-headers-not-being-sent-with-request
Any help would be appreciated. Thanks.