What are key annotations that are present in the JAX-RS API?

DWQA QuestionsCategory: Web Design HTMLWhat are key annotations that are present in the JAX-RS API?
Editor Staff asked 1 month ago

What are key annotations that are present in the JAX-RS API?

1 Answers
Editor Staff answered 1 month ago
  • @Path – This specifies the relative URI path to the REST resource.
  • @GET – This is a request method designator which is corresponding to the HTTP GET requests. They process GET requests.
  • @POST – This is a request method designator which is corresponding to the HTTP POST requests. They process POST requests.
  • @PUT – This is a request method designator which is corresponding to the HTTP PUT requests. They process PUT requests.
  • @DELETE – This is a request method designator which is corresponding to the HTTP DELETE requests. They process DELETE requests.
  • @HEAD – This is a request method designator which is corresponding to the HTTP HEAD requests. They process HEAD requests.
  • @PathParam – This is the URI path parameter that helps developers to extract the parameters from the URI and use them in the resource class/methods.
  • @QueryParam – This is the URI query parameter that helps developers extract the query parameters from the URI and use them in the resource class/methods.
  • @Produces – This specifies what MIME media types of the resource representations are produced and sent to the client as a response.
  • @Consumes – This specifies which MIME media types of the resource representations are accepted or consumed by the server from the client.