I can't make a DELETE with CORS and AngularJS

2019-09-07 21:06发布

I'm trying to make a DELETE request with AngularJS.

I'm sending this headers from the Server:

header('Access-Control-Allow-Origin: *');
header('Access-Control-Allow-Headers: origin, x-requested-with, content-type, accept');
header('Access-Control-Allow-Method: GET, POST, OPTIONS, DELETE');

But in Chrome, when I do an

$http({method: 'DELETE', url: EmployeesURL + "remove/id/" + id}) 

it throws a Method DELETE is not allowed by Access-Control-Allow-Methods. error.

1条回答
不美不萌又怎样
2楼-- · 2019-09-07 21:21

Looks like you are missing an 's' Access-Control-Allow-Methods

查看更多
登录 后发表回答