HTTP code status 202 and async requests
I have been researching for async ways to request a resource. Mostly for use with images and video that needs some kind of expensive transformation or are generated. I first thought of asking a resource, send a json indicating it was accepted and an eta, and re-request the resource on that eta with js.
However, I found the 202 status code. But the rfc is really lacking info:
The 202 (Accepted) status code indicates that the request has been accepted [...], but the processing has not been completed. [...] is intentionally noncommittal. Its purpose is to allow a server to accept a request [...] without requiring that the user agent's connection to the server persist until the process is completed. The representation sent [...] ought to describe the request's current status and point to (or embed) a status monitor [...] with an estimate [...] .
So, someone know what is the behavior of browsers at this status code?, specially interested when the request is due to an img/video html tag. It is really an useful status code, or it behaves like an 200 and it's only semantic fluff? Have someone seen this code on the wild? What's then the use of this code?
I feel that it will not help with my case, but regardless I want know more about this 202 code.
1 comments · 100% upvoted · other discussions
202 is usually used for long running processes. You start a job and you get 202 back with a link to a request to check the current status of the job.