How to complete the challenge GET /todos (406) unsupported +json
This challenge asks for a structured +json media type that the todo endpoint does not support as a normal resource representation.
Issue a GET request on the
/todosend point with anAcceptheader such asapplication/problem+jsonorapplication/*+jsonto receive 406 'NOT ACCEPTABLE' status code.
Basic Instructions
- Issue a
GETrequest to/todos - Add the
X-CHALLENGERheader to track challenge completion - Set
Accepttoapplication/problem+json - Check that the response status is
406
Try it now
GET /todos with unsupported problem JSON Accept
Example Request
> GET /todos HTTP/1.1
> Host: apichallenges.com
> X-CHALLENGER: x-challenger-guid
> Accept: application/problem+json
Example Response
< HTTP/1.1 406 Not Acceptable
< Content-Type: application/json
< X-Challenger: x-challenger-guid
The API may still format its error payload as application/json, but that is not the same as returning the requested todo representation.
Lessons Learned
application/problem+jsonis normally an error document media type, not a todo collection representation.application/*+jsondoes not match plainapplication/jsonbecause the plain subtype does not end in+json.- Structured media types need explicit endpoint support before they can be used in
Acceptnegotiation.
Suggested Experiments
- Retry with
Accept: application/problem+json, application/json;q=0.5and confirm that the supported fallback can succeed. - Send
Accept: application/vnd.apichallenges.todo+jsonand check whether the API advertises that vendorJSONrepresentation. - Compare this failure with
Accept: application/*+xml, which can match a supported structured todoXMLrepresentation.