If http://localhost/api/do_job kicks off a job on the backend that will take 45-120 seconds to complete,
what should the API return?
Eg:
202 Accepted
{ "job_id": 103859195, "poll": "http://localhost/poll/103859195", "complete": "0%" }
You send:
GET http://localhost/poll/103859195
And get back:
200 OK
{ "job_id": 103859195, "poll": "http://localhost/poll/103859195", "complete": "86%" }
You send:
GET http://localhost/poll/103859195
And get back:
200 OK
{ "job_id": 103859195, "data": .... }
Send:
POST http://localhost/api/do_job
{ "callback": "http://myserver.com/hitme" }
Returns:
200 OK
{ "job_id": 103859195 }
A while later, the server goes:
POST http://myserver.com/hitme
{ "job_id": 103859195, "complete": "100%", "data": .... }
To all who may comment: I have my initial gut feeling but I want to hear your thoughts first.