Bird
Raised Fist0

Which of the following is the correct syntax for a pagination link in an HTTP Link header?

easy📝 Syntax Q3 of Q15
Rest API - HATEOAS and Linking
Which of the following is the correct syntax for a pagination link in an HTTP Link header?
ALink: "https://api.example.com/items?page=2" rel='next'
BLink: https://api.example.com/items?page=2 rel=next
CLink: <https://api.example.com/items?page=2> rel=next
DLink: <https://api.example.com/items?page=2>; rel="next"
Step-by-Step Solution
Solution:
  1. Step 1: Review the correct format for Link header

    The Link header requires URLs enclosed in angle brackets and rel attribute in quotes.
  2. Step 2: Match the correct syntax

    Link: ; rel="next" correctly uses angle brackets around the URL and quotes around the rel value.
  3. Final Answer:

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

    Correct Link header syntax = Link: ; rel="next" [OK]
Quick Trick: Use and rel="value" in Link header [OK]
Common Mistakes:
MISTAKES
  • Missing angle brackets around URL
  • Not quoting rel attribute
  • Incorrect spacing or punctuation

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Rest API Quizzes