Bird
0
0

Which of the following is the correct syntax for a Link header indicating the previous page URL https://api.example.com/items?page=1?

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

    The correct format is Link: <URL>; rel="relation" with angle brackets around URL and rel in quotes.
  2. Step 2: Check each option

    Link: ; rel="prev" matches the correct syntax. Others have misplaced parts or missing quotes.
  3. Final Answer:

    Link: <https://api.example.com/items?page=1>; rel="prev" -> Option A
  4. Quick Check:

    Link header syntax = <URL>; rel="type" [OK]
Quick Trick: Use angle brackets for URL and quotes for rel value [OK]
Common Mistakes:
  • Omitting angle brackets around URL
  • Not quoting the rel value
  • Swapping order of URL and rel

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Rest API Quizzes