Chapter 4

  1. REST is an architectural style for creating web services, and it defines a set of constraints.
  2. The easiest way to create a RESTful web service with Spring Boot is to use the Spring Data REST starter package. By default, the Spring Data REST package finds all public repositories and creates automatically RESTful web services for your entities.
  3. You can send a GET request to the endpoint of the entity. For example, if you have an entity class called Car, the Spring Data REST package creates an endpoint called /cars that can be used to fetch all cars.
  1. You can send a DELETE request to the endpoint of the individual entity item. For example, /cars/1 deletes a car with the ID 1.
  2. You can send a POST request to the endpoint of the entity. The header must contain the Content-Type field with the application/json value. The new item will be embedded in the request body.
  3. You can send a PATCH request to the endpoint of the entity. The header must contain the Content-Type field with the application/json value. The updated item will be embedded in the request body.
  4. You have to annotate your repository using the @RepositoryRestResource annotation. The query parameters are annotated using the @Param annotation.
..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.143.168.172