Challenge - 5 Problems
Media Type Versioning Master
Get all challenges correct to earn this badge!
Test your skills under time pressure!
❓ Predict Output
intermediate1:30remaining
What is the HTTP Content-Type header for version 2 of the API?
Given the following media type versioning scheme, what is the correct Content-Type header to request version 2 of the API?
application/vnd.example.api.v2+jsonAttempts:
2 left
💡 Hint
Look for the version number embedded directly in the media type string.
✗ Incorrect
In media type versioning, the version is part of the media type string, like 'v2' in 'application/vnd.example.api.v2+json'.
🧠 Conceptual
intermediate1:30remaining
Why use media type versioning in REST APIs?
Which of the following is the main reason to use media type versioning in REST APIs?
Attempts:
2 left
💡 Hint
Think about how clients tell the server which version they want.
✗ Incorrect
Media type versioning lets clients specify the API version in HTTP headers like Accept or Content-Type, keeping URLs clean and supporting multiple versions.
❓ Predict Output
advanced1:30remaining
What is the server response Content-Type for a request with Accept: application/vnd.example.api.v3+json?
If a client sends the header:
What should the server respond with in the Content-Type header?
Accept: application/vnd.example.api.v3+jsonWhat should the server respond with in the Content-Type header?
Attempts:
2 left
💡 Hint
The server should match the version requested by the client.
✗ Incorrect
The server responds with the same media type version requested by the client in the Accept header.
❓ Predict Output
advanced1:30remaining
What error occurs if the client requests an unsupported media type version?
If a client sends:
and the server only supports versions 1 to 3, what HTTP status code should the server return?
Accept: application/vnd.example.api.v99+jsonand the server only supports versions 1 to 3, what HTTP status code should the server return?
Attempts:
2 left
💡 Hint
Think about how servers respond when they cannot provide the requested media type.
✗ Incorrect
406 Not Acceptable means the server cannot produce a response matching the Accept header.
🧠 Conceptual
expert2:00remaining
What is a key advantage of media type versioning over URL versioning?
Which of the following best describes a key advantage of media type versioning compared to versioning via URL paths?
Attempts:
2 left
💡 Hint
Consider how clients and servers handle multiple versions simultaneously.
✗ Incorrect
Media type versioning uses content negotiation so different versions can be served from the same URL, unlike URL versioning which requires different URLs.