【发布时间】:2018-06-15 00:03:01
【问题描述】:
我正在尝试在 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 好的
【问题讨论】:
标签: rest jakarta-ee jax-rs wildfly http-patch