我正在使用此HTTP请求代码向Couchbase桶/文档发送json数据。我不知道为什么会像"XMLHttpRequest send Failed to load resource: the server responded with a status of 405 (MethodNot Allowed)"那样抛出错误
当我测试它时,它通过Postman运行得很好。
GET /register/register/newUser调用此操作,我会得到一个数据绑定失败,因为newUser不能绑定到用户的Long id属性。乍一看,这似乎是合理的,但是,在通过HTTP GET调用user时,不应该尝试绑定它,因为我已经声明只允许POST。User user = new User(params)}
并再次尝试使用GET /register/register/newUser调用它,然后我得到了预期的HTTP methodno
当我试图通过JavaScript (jQuery)向该API发送HTTP请求时,我会得到以下错误:
Origin http://localhost is not allowed by Access-Control-Allow-OriginAPI调用的代码是:urllib2.urlopen('http://192.168.0.99/api/status').read()和这个请求运行良好,并<