有角度的http.post是否需要自定义才能用作Invoke-WebRequest?
在测试Web服务器之后,使用Invoke-WebRequest
当我将以下脚本与Angular一起使用
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);
});
});
我称该方法为
this.authService.postData(this.userData, "Login").then((result) =>{
服务器回复
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://../