【发布时间】:2014-02-27 02:12:17
【问题描述】:
我想使用 JSON 从我的客户端应用程序/json 请求发送
{ "content" : "My content", "question" : "WHY?" }
Jersey rest 中是否有某种方法可以在服务器端检索此 JSON,例如:
@POST
@Path("/myMethod")
@Consumes(MediaType.APPLICATION_JSON)
public void myServerMethod(@FormParam("content") String content, @FormParam("question") String question) {
System.out.println(content+" "+question);
}
现在我无法从 json 的正文中检索值。
最好的问候
【问题讨论】: