https://www.oscarblancarteblog.com/api-rest-java-jax-rs/
Para responder con JSON:
@GET
@Path("/json")
public Response getJsonResponse() {
Person person = new Person("Abhinayak", "Nepal");
return Response
.status(Response.Status.OK)
.entity(person)
.type(MediaType.APPLICATION_JSON)
.build();
}
No hay comentarios:
Publicar un comentario