Spring Boot Response Entity Overview | Rest Controller | Rest API

preview_player
Показать описание
Hi guys,

In this lesson, we will talk about how we can create rest api methods in spring.

In the rest controller, we can describe every method with ResponseEntity capsulation.
ResponseEntity is a capsulation that contains http header, http status and response body.
We can create our methods in different request types. We can create a post-request-method, get-mapping-method, put-mapping, delete-mapping etc.
For example, if we create a PostMapping, We can reach the form data of request with @RequestBody annotation. With using RequestBody annotation we can reach form-data. Similarly, we have RequestParam and PathVariable annotations to reach endpoint variables. With RequestParameter, we can reach the query variables in the rest url. Or with using PathVariable, we can reach the variables in the url path. At this point, Spring rest api provides many utilities.

In the next lessons, we will see the example cases about it and we will understand it better.

That’s all.
Thank you.
Рекомендации по теме