@Path("/users")public class UserService {
@GET
@Path("/get")
public Response addUser(@HeaderParam("user-agent") String userAgent) {
Response response = Response.status(200).
entity("yourEntity").
header("Content-Type", "application/json; charset=utf-8").build();
return response;
}
}
转载于:https://my.oschina.net/stevenliuit/blog/223736