Hello,
I make two posts testing in ios simulator:
- with angular http which works fine
public login(): Observable<string> {
let headers = new Headers({'Content-Type': 'application/x-www-form-urlencoded'});
let options = new RequestOptions({headers: headers, withCredentials: true});
let params: URLSearchParams = new URLSearchParams();
params.set('target', 'XXX');
params.set('username', XXX);
params.set('password', XXX);
return this.http.post(BACKEND_URL, params, options)
.map(this.returnData)
.catch(this.handleError);
}
- with native http using cordova gets an error
public login(): Observable<string> {
let params = {
'target': 'XXX',
'username': XXX,
'password': XXX
};
let headers = {'Content-Type': 'application/x-www-form-urlencoded'};
this.http.acceptAllCerts(true);
this.http.disableRedirect(false);
let responseData = this.http.post(BACKEND_URL, JSON.stringify(params), headers);
return Observable.fromPromise(responseData)
.map(this.returnData)
.catch(this.handleError);
}
I am looking for a solution a long time but can’t find any
I place the cacerts file in target folder created in project folder.
Can someone help please