我希望获得每个Json格式化调用的键和值,并将它们用作Java对象,如String或Integer,在其他客户端我将输入{"Name":"HelloWorld"}
我会回到HelloWorld映射到它的Key到目前为止我见过的例子,但我只是很难找出每个标签做什么以及如何解析身体给出上述结果
@POST
@Path("/SetFeeds")
@Consumes(MediaType.APPLICATION_JSON)
@Produces(MediaType.APPLICATION_JSON)
@JsonCreator
public String setFeed(String jsonBody,@Context UriInfo uriInfo){
...Code to manipulate the body of the request
return response;
}
Run Code Online (Sandbox Code Playgroud)