In REST APIs, hypermedia is often called HATEOAS. What is the main reason hypermedia drives better discoverability?
Think about how clients learn what to do next without prior knowledge.
Hypermedia embeds links inside API responses, allowing clients to navigate the API dynamically. This means clients discover available actions by following links, improving discoverability.
Given this JSON response from a REST API using hypermedia, what is the next URL the client should request?
{
"user": {"id": 1, "name": "Alice"},
"_links": {
"self": {"href": "/users/1"},
"orders": {"href": "/users/1/orders"}
}
}Look for the link that represents the next logical resource related to the user.
The "orders" link shows the URL to get the user's orders. This is the next discoverable action.
This client code tries to follow hypermedia links but fails. What is the likely cause?
response = api_call('/users/1') next_url = response['links']['orders']['href'] next_response = api_call(next_url)
Check the exact key names used in hypermedia responses.
The standard hypermedia key is '_links', but the code accesses 'links', causing a KeyError and failure to find next actions.
Which option contains a syntax error in the hypermedia JSON structure?
{
"_links": {
"self": {"href": "/items/5"},
"next": {"href": "/items/6"}
}
}Look for trailing commas in JSON objects.
Option B has a trailing comma after the last item in the '_links' object, which is invalid JSON syntax.
Consider a client that uses hypermedia-driven REST API responses. Which statement best explains how hypermedia enables client flexibility?
Think about how clients discover resources without prior knowledge.
Hypermedia allows clients to discover and navigate API resources dynamically by following links, so they don't break when URLs change.