-
Book Overview & Buying
-
Table Of Contents
-
Feedback & Rating

Hands-On Microservices with Kotlin
By :

In RESTful APIs, we use standard HTTP verbs to indicate what we need to do with a particular resource. These verbs define what the client needs to do, but we need to answer in our microservice what response we give back.
For example, when a client asks for a specific customer using the URL http://localhost:8080/customer/1
with the HTTP verb GET
, we can answer back with a status 200 OK
, or with a 404 NOT FOUND,
if we don't find the customer.
This two-way communication becomes part of a conversation between the client and the API and will form our ubiquitous language.
In RESTful APIs, HTTP verbs and statuses are very flexible, and our application can decide how to use them, but there are a set of standard and well-known patterns to combine them.
Considering that we are using an API that provides a resource through a URL, for example /customer
, we can use:
URL | VERB | STATUS | MEANING |
|
|
| We asked for a specific customer... |