I'm trying to debug ionic app in mac:
$ ionic cordova emulate ios -- --buildFlag="-UseModernBuildSystem=0" --debug
In one of the requests of API SERVER(.NET) I get the error:
Request header field Content-Type is not allowed by Access-Control-Allow-Headers
login(login: LoginModel | null): Observable<LoginInfo | null> {
let url_ = this.baseUrl + "/API/Login/Login";
url_ = url_.replace(/[?&]$/, "");
const content_ = JSON.stringify(login);
let options_ : any = {
body: content_,
observe: "response",
responseType: "blob",
headers: new HttpHeaders({
"Content-Type": "application/json",
"Accept": "application/json"
})
};
return this.http.request("post", url_, options_).flatMap((response_ : any) => {
return this.processLogin(response_);
}).catch((response_: any) => {
if (response_ instanceof HttpResponseBase) {
try {
return this.processLogin(<any>response_);
} catch (e) {
return <Observable<LoginInfo | null>><any>Observable.throw(e);
}
} else
return <Observable<LoginInfo | null>><any>Observable.throw(response_);
});
}