我在登录时遇到问题。注册工作正常。技术栈——HTML/AJAX/JQuery->Resteasy (Wildfly 10.1.0 Final)
我有网址 - https://www.test.com/login.html
- (实际网址名称已修改)
当我使用方法 type = 提交表单时"POST"
,它总是抛出 405 Method not allowed 。
下面是代码部分:
submitHandler: function(form) { // fires only when form is valid
var loginData = formJSONLoginData();
$.ajax({
url:"https://"+getUrl()+"/curAuthService/curAuth/authenticateUser/v1",
type : "POST",
dataType : "json",
contentType: "application/json",
data: loginData,
success : function(response) {
},
error: function( xhr, status, error ){
}
});
return false;
},
Rest API 如下:
@Path("/curAuth")
public class FHAuthResource {
@POST
@Path("/authenticateUser/v1")
@Produces("application/json")
@Consumes("application/json")
public String authenticateUser( AuthVO authVO ) {
}
}
如果有人可以帮助/建议我哪里出错了,那将是非常有帮助的。
注册采用类似的格式,并且运行良好。
终极愚蠢的错误。错过了resteasy所需的应用程序文件的“扩展应用程序”。
本文收集自互联网,转载请注明来源。
如有侵权,请联系[email protected] 删除。
我来说两句