Posts behave differently


I make two posts testing in ios simulator:

  1. 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, params, options)
  1. 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'};
    let responseData =, JSON.stringify(params), headers);
    return Observable.fromPromise(responseData)

I am looking for a solution a long time but can’t find any :frowning:
I place the cacerts file in target folder created in project folder.

Can someone help please

The error is no target is defined. But I add it to the body. Please help

Post the complete and exact error message please.

From console: 404 - undefined

The redirect is not made, but I dont know why. It is specified in the body.
The first approach witn angular-http works.

Fixed make the body as string seperated each param with &