Resource manipulation through representations is a REST uniform-interface principle: clients use a resource URI, its representation, and the appropriate HTTP method to read, modify, delete, or create related resources without extra implementation-specific information. section 1.1.4 section 3.1.6
A representation supports manipulation when it:
- Identifies the target resource through a unique URI. section 1.1.4
- Uses standard HTTP methods such as GET and DELETE at that URI, with other methods applying corresponding operations. section 1.1.4
- Includes descriptive links that tell clients how to alter the resource or request related resources, when permitted. section 3.1.6
Board-game resource
A client can read board game 11 with GET https://mybglist.com/api/games/11 and delete it with DELETE at the same URI. A collection representation can also expose links such as self with its href, relation, and HTTP type. section 1.1.4 section 3.1.6
{
"data": [
{
"id": 1,
"name": "Axis & Allies",
"year": 1981
},
{
"id": 2,
"name": "Citadels",
"year": 2000
},
{
"id": 3,
"name": "Terraforming Mars",
"year": 2016
}
],
"links": [
{
"href": "https://localhost:40443/BoardGames",
"rel": "self",
"type": "GET"
}
]
}
Inspect the JSON envelope showing board-game data alongside a self link with its URI, relation, and HTTP method. section 3.1.6
