A REST endpoint lets a client reach backend functionality through an HTTP request. Unlike a conventional website response, which usually contains HTML, a REST API response typically contains data such as JSON or XML. That makes the same backend useful to browser applications, phones, and other clients. section 7.0 section 7.1
In Spring MVC, a controller method becomes an endpoint when a request-handling annotation maps HTTP requests to it. For example, an endpoint can fetch recently created tacos. @GetMapping handles reads, while @PostMapping handles requests that create a resource; Spring MVC also provides mappings for updates and deletes. section 7.1
Table 7.1 Spring MVC’s HTTP request-handling annotations (view table figure)
| Typical usea |
||
|---|---|---|
| General-purpose request handling; HTTP |
||
| a Mapping HTTP methods to create, read, update, and delete (CRUD) operations isn’t a perfect match, but in practice, that’s how they’re often used and how you’ll use them in Taco Cloud. |
||
Use the annotation table to choose a mapping for the HTTP method and intended operation. The HTTP-method-to-CRUD correspondence is a practical convention, not a perfect equivalence. section 7.1
A reactive endpoint can instead use a functional route. A RequestPredicate matches a request, and a handler produces a ServerResponse. In the example, route(GET("/hello"), …) matches GET /hello and returns HTTP 200 with “Hello World!” in the body; andRoute adds a separate GET /bye handler. section 12.2
@Bean
public RouterFunction<?> helloRouterFunction() {
return route(GET("/hello"),
request -> ok().body(just("Hello World!"), String.class))
.andRoute(GET("/bye"),
request -> ok().body(just("See ya!"), String.class))
;
}
This listing shows two HTTP endpoints declared together with route and andRoute. section 12.2
Do not confuse an HTTP endpoint with every use of “route.” An RSocket controller maps messages to a named route with @MessageMapping rather than handling HTTP requests at a path. section 14.2.1

























