- Hands-On RESTful Web Services with TypeScript 3
- Biharck Muniz Araújo
- 98字
- 2021-07-02 12:19:18
The manipulation of resources using representations
Following the happy path, when the client makes a request to the server, the server responds with a resource that represents the current state of its resource. This resource can be manipulated by the client. The client can request what kind it desires for the representation such as JSON, XML, or plain text.
When the client needs to specify the representation, the HTTP Accept header is used.
Here you can see an example in plain text:
GET https://<HOST>/orders/12345
Accept: text/plain
The next one is in JSON format:
GET https://<HOST>/orders/12345
Accept: application/json