ASP.NET Core Web API Interview Question #168
What does HTTP 202 Accepted mean?
Testing, HttpClient, Integration Testing, Background Services & Deployment Senior Advanced
Quick Interview Answer
202 Accepted means the request has been accepted for processing but the processing has not yet completed. It is suitable for asynchronous workflows where work continues after the HTTP response.
Detailed Explanation
202 Accepted means the request has been accepted for processing but the processing has not yet completed. It is suitable for asynchronous workflows where work continues after the HTTP response.
A useful design provides a way to observe job status or eventual outcome, commonly through a Location header or job resource.
Code Example
return AcceptedAtAction(
nameof(GetJob),
new { id = job.Id },
new { jobId = job.Id, status = "Queued" });