I'm trying to execute a login form with Angular2 with NodeJS API as a backend server.
I cant't post any request to the API. Here it's my front code example:
private authenticate_url = "Server_URL:PORT/authenticate";
login(username: string, password: string): Observable<User> {
let headers = new Headers({ 'Content-Type': 'application/json' });
let options = new RequestOptions({ headers: headers });
console.log("Username : "+username+" Password : "+password);
return this.http.post(this.authenticate_url, { username, password }, options)
.map(this.extractData)
.catch(this.handleError)
}
Either when I'm checking network activity, no POST request was executed.
via BenChaaben Tarek
No comments:
Post a Comment