POST Challenger 201 Solution
How to complete the challenge POST /api/challenger 201.
POST /api/challenger (201)
Issue a POST request on the
/api/challengerend point, with no body, to create a new challenger session. Use the generated X-CHALLENGER header in future requests to track challenge completion.
- This challenge is essential if you want to persist your sessions in multi-user mode
- This challenge is optional if you want to work in single-user mode
Basic Instructions
- Issue a POST request to end point "/api/challenger"
https://apichallenges.com/api/challenger
- The response will have an
X-CHALLENGERheader - Use this in any future requests to track your progress
- The
LOCATIONheader has a url to access your challenge status through the GUI
Try it now
POST /api/challenger to create a new challenger session
Example Request
POST /api/challenger HTTP/1.1
Host: localhost:4567
User-Agent: rest-client
Accept: */*
Content-Length: 0
Example Response
HTTP/1.1 201 Created
Date: Tue, 28 Jul 2020 14:26:48 GMT
X-CHALLENGER: rest-api-challenges-single-player
Location: /gui/challenges
Content-Type: text/html;charset=utf-8
Transfer-Encoding: chunked
Server: Jetty(9.4.z-SNAPSHOT)
Overview Video
Lessons Learned
POST /api/challengercreates a new session resource and returns its identifier inX-CHALLENGER.- Session creation is the setup step that makes later challenge completion trackable.
- The session
idis both response data and a required request header for future work.
Suggested Experiments
- Create two challenger sessions and compare how their
X-CHALLENGERvalues isolate progress. - Use a newly returned
X-CHALLENGERonGET /api/challengesand confirm completion starts from a fresh state.