Retrying 202 #707
Replies: 3 comments 3 replies
-
202 means the server accepted the request but hasn’t finished processing. Retrying risks duplicating work or causing side effects. It's not an error; it's intentional deferral. The correct pattern is polling a status endpoint, not resending the request. |
Beta Was this translation helpful? Give feedback.
-
Maybe we could check the |
Beta Was this translation helpful? Give feedback.
-
@sindresorhus what HTTP status code would you expect to be returned from an endpoint that should be polled? For example, if a status for an object can be either pending, completed or failed, would you expect the HTTP code returned from the server to be the same for each status (i.e. a 200)? |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Setting 202 as a status code for retries doesn't seem to trigger retries on 202 responses. Should it?
I'm guessing it's seeing 2XX as successful. Looking at the docs for 202 response it would make sense to be able to retry this status code.
Beta Was this translation helpful? Give feedback.
All reactions