Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

HTTP status code for in progress?

Tags:

rest

http

I have an endpoint that looks something like this: GET: /v1/resourcebeingcreated/status

Is there a preferred HTTP status code to return (beyond 200 with a response body that explains "in progress") if the loading/creation of this resource is in progress but not complete?

If not, is the best way to return the "in progress" status in a header or the response body?

like image 441
theMothaShip Avatar asked Nov 04 '22 09:11

theMothaShip


1 Answers

  1. http://en.wikipedia.org/wiki/List_of_HTTP_status_codes#2xx_Success - no. :)
  2. I think it should depend on what you are trying to achieve. Is it that you trying to notify a third party somehow? If you are defining your own API, that would be OK I guess to set it in the header. Yet, a more common and more intuitive approach is the body.
like image 156
povilasp Avatar answered Nov 11 '22 04:11

povilasp