Complete the code to add a 'self' link relation in the JSON response.
response = {
"_links": {
"self": {"href": [1]
}
}The 'self' link relation should contain the full path to the current resource, typically starting with a slash.
Complete the code to add a 'next' link relation pointing to the next page.
response = {
"_links": {
"next": {"href": [1]
}
}The 'next' link should point to the next page, which is page 2 in this example.
Fix the error in the link relation key to correctly represent the 'prev' link.
response = {
"_links": {
[1]: {"href": "/api/items?page=1"}
}
}The standard link relation for the previous page is 'prev'.
Fill both blanks to add 'self' and 'related' link relations in the response.
response = {
"_links": {
[1]: {"href": "/api/items/5"},
[2]: {"href": "/api/items/5/related"}
}
}'self' points to the current resource, and 'related' points to related resources.
Fill all three blanks to create a response with 'self', 'next', and 'prev' link relations.
response = {
"_links": {
[1]: {"href": "/api/items/10"},
[2]: {"href": "/api/items?page=11"},
[3]: {"href": "/api/items?page=9"}
}
}'self' is the current item, 'next' is the next page, and 'prev' is the previous page.