Does angular $http.post require customization to work as Invoke-WebRequest ?
After testing a web server, with Invoke-WebRequest
When I used the following script with Angularjs
postData(credentials){
return new Promise((resolve, reject) =>{
let headers = new Headers();
this.http.post(loginUrl, JSON.stringify(credentials) , {headers: headers}).
subscribe(res =>{
resolve(res.json());
}, (err) =>{
reject(err);
});
});
I called the method as
this.authService.postData(this.userData, "Login").then((result) =>{
The server responded with
Failed to load resource: the server responded with a status of 500 (Internal Server Error)
login.ts:50 error Response with status: 500 Internal Server Error for URL:
http://../


Aucun commentaire:
Enregistrer un commentaire