Testing 202 Accepted and async job polling

202 Accepted is the status clients mishandle most, because it is a success response for work that has not happened. The Protocol Lab models the full pattern: submit, receive a 202 with a status URL, poll until the job resolves, and handle the job that fails rather than completes.

How to practise it

  1. Submit a job, read the Location header from the 202, and poll it rather than assuming the work is done.
  2. Poll with a sensible interval and a ceiling — a tight loop against a job that never finishes is its own outage.
  3. Handle the job that completes with a failure: the poll succeeded, the work did not.
  4. Check what your client does when the job outlives your overall timeout.
  5. Combine with the 503 and 504 endpoints to see polling behave under an unreliable upstream.

APIs to try it on

Status codes involved

Other techniques

Getting started guide · All 37 mock REST APIs