You want to provide navigation links for first, previous, next, and last pages in your API response. Which of the following Link header values correctly includes all these relations?
hard📝 Application Q15 of 15
Rest API - Pagination Patterns
You want to provide navigation links for first, previous, next, and last pages in your API response. Which of the following Link header values correctly includes all these relations?
The correct format is Link: <URL>; rel="relation", <URL>; rel="relation" etc., with URL in <>, semicolon, rel= with value in quotes.
Step 2: Evaluate each option
Link: <https://api.example.com/items?page=1>; rel="first", <https://api.example.com/items?page=2>; rel="prev" etc. matches exactly. The similar one has 'rel first' (missing = after rel). Others miss semicolons, have rel before URL, or wrong separators.