Curs 8 - RESTful Web Services
Curs 8 - RESTful Web Services
Curs 8 - RESTful Web Services
Serviciile RESTful
JAX-RX
JAX-RS Annotations
Documentation: https://jersey.java.net/documentation/latest/jaxrs-resources.html
@Path("/calc")
public class CalcREST {
@GET
@Path("/add/{a}/{b}")
@Produces(MediaType.TEXT_PLAIN)
public String addPlainText(@PathParam("a") double a, @PathParam("b") double b) {
@POST
@Consumes("application/json")
@Produces("application/json")
public RestResponse<Contact> create(Contact contact) {
@PUT
@Consumes("application/json")
@Produces("application/json")
@Path("{contactId}")
public RestResponse<Contact> update(Contact contact) {
Practice