我正在使用离子调用HTTPPOST方法,该API正在使用REST API测试工具POSTMAN,但是Angular POST Requset并未击中该API
下面的离子代码
TYPE_SYSTEM_OVERLAY
我的ASP.NET API代码如下所示
import { Injectable } from '@angular/core';
import { Http, Headers } from '@angular/http';
import 'rxjs/add/operator/map';
let apiUrl = 'http://localhost:52998/api/Default/login';
@Injectable()
export class AuthService {
constructor(public http: Http) {}
login(credentials) {
debugger;
return new Promise((resolve, reject) => {
let headers = new Headers();
headers.append('Content-Type', 'application/json');
this.http.post(apiUrl+'AddEmployee', JSON.stringify(credentials), {headers: headers})
.subscribe(res => {
resolve(res.json());
}, (err) => {
reject(err);
});
});
}
将API称为IONIC后,我会在上一次Debug的控制器名称上方看到Application Insight的增加,请帮我弄清楚,图像的屏幕截图位于: