我对Angular 2 http.delete
方法有疑问。我的代码如下:
const headers = new Headers({'Content-Type': 'application/x-www-form-urlencoded'});
this.http.delete(ConstVarService.url + 'api/tasks/UsunZapis', new RequestOptions({
headers: headers,
body: {tasksId: entryId}
})).subscribe((data) => {
console.log(data)
});
当我执行时,我收到以下错误:
OPTIONS http://192.168.13.36/pplus-dev/appapi/api/tasks/UsunZapis 405 (Method Not Allowed)
Failed to load http://192.168.13.36/pplus-dev/appapi/api/tasks/UsunZapis: Response for preflight has invalid HTTP status code 405
但是在Postman中一切正常,相同的URL,内容类型等。