【发布时间】:2015-04-21 06:44:15
【问题描述】:
让我们假设,对于我的 Jersey 项目,有人试图以字符串的形式发送请求(字符串是通过转换一些 json 详细信息如用户名和密码获得的)。我的 java 代码能够接受吗?
@Path("/customers")
public class Authentication {
@POST
@Path("/get")
@Consumes(MediaType.APPLICATION_JSON)
public Response getRequestUrl(String JSON_DATA) {
System.out.println("inside Authentication");
// String output = s.toString();
return Response.status(201).entity(JSON_DATA).build();
}
如果不是如何接受进一步处理的请求。任何人都可以给出解释(特别是关于 get 和 post 方法)。提前谢谢
【问题讨论】: