From the course: Java EE 8: Web Services

Unlock the full course today

Join today to access over 22,600 courses taught by industry experts or purchase this course individually.

Handle different HTTP methods in JAX-RS

Handle different HTTP methods in JAX-RS - Java EE Tutorial

From the course: Java EE 8: Web Services

Start my 1-month free trial

Handle different HTTP methods in JAX-RS

- [Instructor] Allow me to sing you the song of my people in the form of the various HTTP methods supported by JAX-RS. At the same time, we will recap the correct use of some of those HTTP methods in RESTful design. And here they are. We have the GET method, supported by the @GET annotation and in REST, you should use this to retrieve information without any side effects. Clients should be able to hit the RESTful endpoint with a GET request repeatedly without any side effects. The word for that is idempotent. That means it should be repeatable without any change in the response. You will hear that word come up a lot more. Next, we have the HTTP POST supported by the @POST annotation. Use this method and this annotation for endpoints that support saving information. And the saving is not required to be idempotent. Clients should expect that sending data repeatedly to a POST endpoint can cause side effect. Following that,…

Contents