我不能让一个删除与CORS和AngularJS [英] I can't make a DELETE with CORS and AngularJS

查看:175
本文介绍了我不能让一个删除与CORS和AngularJS的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我试图与AngularJS一个DELETE请求。

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');

但在Chrome中,当我做一个

But in Chrome, when I do an

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

它抛出一个的方法Delete没有被访问控制允许的方法允许的。的错误。

推荐答案

看起来像你缺少一个s的访问控制允许的方法

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

这篇关于我不能让一个删除与CORS和AngularJS的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆