HTTP status code in process?

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

Is there a preferred HTTP status code for return (beyond 200 with a response body that explains β€œin process”) if loading / creating this resource is done but not completed?

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

+5
source share
1 answer
  • http://en.wikipedia.org/wiki/List_of_HTTP_status_codes#2xx_Success - no. :)
  • I think it should depend on what you are trying to achieve. Are you trying to somehow notify a third party about this? If you define your own API, that would be fine, I think, to set it to the header. However, the body is a more common and more intuitive approach.
+2
source

Source: https://habr.com/ru/post/956158/


All Articles