What should be the Http status code for a pending request?

I have a server that takes a file, parses it and sends the result back at the request of the client. In some cases, there are some files that are inserted into the queue and wait for the analyzer to complete its work. At the same time, if the result of the analysis is awaiting a response , the client may request a result. So what should be the code Http statusin this case?

+4
source share
3 answers

In the w3c 202 specification, this status has been accepted by the server (and is still being processed).

The request has been accepted for processing, but processing has not been completed. The request may or may not end up as it may be prohibited when processing actually takes place. There is no way to resend the status code from such an asynchronous operation.

Answer 202 is intentionally not consistent. Its purpose is to allow the server to accept a request for some other process (possibly a batch-oriented process that starts only once a day) without requiring that the connection between the user agent and the server be maintained until the process is completed. The object returned with this response SHOULD include an indication of the current status of the request and either a pointer to the status monitor or some estimate when the user can expect the request to be completed.

https://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html

+8

202:

202 , . , .

+3

There is no specific separate status code for a pending request. You can predicate it from status code 202

The request has been accepted for processing, but processing has not been completed. The request may or may not ultimately be denied during processing.

The 2xx status code means “Success,” means a request heated to the server, and it is in the process.

+1
source

All Articles