更新时间:2023-12-05 15:01:28
您应该使
@POST
@Path("/mytest")
而不是"getTest"方法.原因如下.
and not "getTest" method.Reason is below.
命令
curl -X POST -d {"method":"mytest","params":{"name":"jack"}} localhost/anythingbutmytest
由于以下原因而接受
@Path("/{method}") .
但是
curl -X POST -d {"method":"mytest","params":{"name":"jack"}} localhost/mytest
由于以下原因而不会接受
will not accept because of
@GET
@Path("/mytest")
POST与GET不匹配.
POST does not match GET.