I tired login like this
singIn(){
var headers = new Headers();
headers.append('Content-Type', 'application/x-www-form-urlencoded' );
let options = new RequestOptions({ headers: headers });
let postParams = {
"Email": this.username,
"Password": this.password,
}
this.http.post("http:mydomainname/api/user",JSON.stringify(postParams),options)
.subscribe(data => {
let serverData =data.json()
let response = serverData.status;
console.log(serverData)
}, error => {
console.log(error);
});
}
when i try to print console.log(serverData) print nothing but when i checked XHR response there showing username and password matched but its directly going to error block and showing this below message
Object { _body: error, status: 0, ok: false, statusText: "", headers: {…}, type: 3, url: null }
how can i fixed that please help me out
Thanks