I found the suggestions from this blog reasonable: REST and long-running jobsREST and long-running jobs.
To summarize:
- Server returns code "202 Accepted"The server responds to job requests with
202 Acceptedand the "Location"Locationheader field set to athe URI for client to checkof the status monitor, e.g. "/queue/12345"/queue/12345. - Until the processingjob finishes, the server responds to status queriesrequests with "200 OK"
200 OKand some response datarepresentation showing job status. - After the processingjob finishes, the server responds to status queriesrequests with "303 See Other"
303 See Otherand "Location" containing URItheLocationheader field set to the finalURI of the job result, e.g./stars/97865. - After the status monitor is deleted manually by the client or automatically by the server, the server responds to status requests with respectively
404 Not Foundor410 Gone.