我正在尝试在wildfly 10.1.0.Final上使用http 补丁方法运行 rest api 。如果我在此端点上发出请求,我会收到405 Method Not Allowed。
我使用javax.javaee-api:8.0。
补丁:
@PATCH
@Path("/documents/{id}")
public Response patchDocument(@PathParam("id") String id,
@ApiParam(value = "", required = true) @Valid PatchRequestSTO jsonPatch) {
return ok(jsonPatch.toString()).build();
}
响应:405 方法不允许
Allow:OPTIONS, PUT
Connection:keep-alive
Content-Length:0
Date:Fri, 05 Jan 2018 07:55:44 GMT
Server:WildFly/10
X-Powered-By:Undertow/1
放:
@PUT
@Path("/documents/{id}")
public Response putDocument(@PathParam("id") String id,
@ApiParam(value = "", required = true) @Valid PatchRequestSTO jsonPatch) {
return ok(jsonPatch.toString()).build();
}
响应:200 好