Ravi Sir's Cards › AWS
HTTP 202 vs 201
This revision card explains HTTP 202 vs 201. It starts from the need that status codes tell clients what “success” means. Wrong codes confuse frontend retries. It describes 201 Created = resource finished. 202 Accepted = request accepted for processing that is not done yet. The how-to section notes intake Lambda returns statusCode 202 and a body with orderId; worker creates the DynamoDB row asynchronously. An example on the card is mobile app shows “Order received” immediately from 202, then polls GET /orders/{id} when you add it later.
Read card text
What this card says
Why do we need it?
Status codes tell clients what “success” means. Wrong codes confuse frontend retries.
What is it?
201 Created = resource finished. 202 Accepted = request accepted for processing that is not done yet.
How to do it
Intake Lambda returns statusCode 202 and a body with orderId; worker creates the DynamoDB row asynchronously.
statusCode: 202
Example
Mobile app shows “Order received” immediately from 202, then polls GET /orders/{id} when you add it later.