URLs in Link headers must be enclosed in angle brackets <> to be valid.
Step 2: Verify other parts
rel attribute is case-insensitive and semicolon is correct separator; query parameters are allowed.
Final Answer:
The URL is missing angle brackets <> -> Option D
Quick Check:
URL must be inside <> in Link header [OK]
Hint: Always put URLs in angle brackets in Link headers [OK]
Common Mistakes:
Omitting angle brackets around URLs
Changing semicolon to comma incorrectly
Thinking rel attribute is case sensitive
5. 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
A. Link: ; rel="first", ; rel="prev", ; rel="next", ; rel="last"
D. Link: rel="first" , rel="prev" , rel="next" , rel="last"
Solution
Step 1: Confirm correct Link header syntax
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.