Bird
Raised Fist0

Which of the following is the correct syntax for a Link header indicating the next page URL?

easy📝 Syntax Q12 of Q15
Rest API - Pagination Patterns
Which of the following is the correct syntax for a Link header indicating the next page URL?
ALink: next=<https://api.example.com/items?page=2>
BLink: <https://api.example.com/items?page=2>; rel="next"
CLink: rel="next" <https://api.example.com/items?page=2>
DLink: <https://api.example.com/items?page=2> next
Step-by-Step Solution
Solution:
  1. Step 1: Recall Link header format

    The correct format is: Link: <URL>; rel="relation" where URL is in angle brackets and rel specifies the link role.
  2. Step 2: Check each option

    Link: ; rel="next" matches the correct syntax with URL in <> and rel="next". Others have incorrect order or missing punctuation.
  3. Final Answer:

    Link: <https://api.example.com/items?page=2>; rel="next" -> Option B
  4. Quick Check:

    Link header syntax = <URL>; rel="next" [OK]
Quick Trick: Link header always uses angle brackets for URLs and rel="next" [OK]
Common Mistakes:
MISTAKES
  • Placing rel before the URL
  • Omitting angle brackets around URL
  • Using incorrect separators or missing semicolons

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Rest API Quizzes