Hello guys,
I have a problem with my HTTP post Request. It work on my browser ( with CORS issues disabled ) but on my iPhone, not working.
In my xcode console i have this : " Response with status: 0 for URL: null " when i try to log.
This is my login services.
// Core components
import { Injectable } from '@angular/core';
import { Http } from '@angular/http';
// RxJS
import 'rxjs/add/operator/toPromise';
import 'rxjs/add/operator/map';
// Models
import { LoginModel } from "../models/login.model";
@Injectable()
export class LoginServices {
private baseUrl: string = '<MY EXTERIOR URL>';
constructor(private http: Http) {
}
public fetchedLogin(email,password): any {
const url = `${this.baseUrl}`;
return this.http.post(url,
{
email : email,
password : password
})
.toPromise()
.then( response => response.json() as LoginModel)
.catch( error => console.log("Error :" + error +" "))
}
I work with an exterior API, not in local.
Idk if we need to set some setting for http.post communication (in config or something like that).
Thanks for ur help !
(srry for my bad english x’) )