Trying to make a angular2 .post( )/.put( ) call, but nothing comes in backend. No errors, nothing. Seems the call just die
import 'rxjs/add/operator/map';
import {Http, Headers, RequestOptions} from '@angular/http';
let body = JSON.stringify(this.user);
let headers = new Headers({
'Content-Type': 'application/json'
});
let options = new RequestOptions({ headers: headers });
return new Promise( ( resolve ) => {
this.http.post( this.LOGIN_URL, body, options )
.map( ( res ) => res.json() )
.subscribe(
( data ) => resolve(data),
( error ) => resolve(error)
);
});
When i change to .get( ) / .delete( ) i receive the call on node backend, so, works fine:
this.http.get( this.LOGIN_URL )
this.http.delete( this.LOGIN_URL )
What is wrong with my .post( ) / .put( ) calls?