Powershell Web请求行为上的角度发布请求行为

时间:2018-08-12 02:38:55

标签: angular powershell web

有角度的http.post是否需要自定义才能用作Invoke-WebRequest?

在测试Web服务器之后,使用Invoke-WebRequest

Powershell request response

当我将以下脚本与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://../

Here is the snapshot of angular request

0 个答案:

没有答案