I have PRIMARY url in web application which accept by POST request some data.
This url send this data to INTERNAL url (not accessable by user)
That INTERNAL url are processing that data for a long time for example 30 min.
My PRIMARY url after post request must redirect to MAIN url. What response HTTP STATUS CODE header I must to send in PRIMARY url after posting?
202? - yes, maybe, because it means "The request has been accepted for processing, but the processing has not been completed."
But I must to redirect back user.. redirects use "3xx" HTTP STATUS CODE. So "303" or not?
HTTP status code 202 or 303. When I need use it?
1.5k Views Asked by LINKeRxUA At
2
Maybe reding rfc2616-sec10 will help you out, they say the following about the status code 202:
The request has been accepted for processing, but the processing has not been completed. The request might or might not eventually be acted upon, as it might be disallowed when processing actually takes place. There is no facility for re-sending a status code from an asynchronous operation such as this.
The 202 response is intentionally non-committal. Its purpose is to allow a server to accept a request for some other process (perhaps a batch-oriented process that is only run once per day) without requiring that the user agent's connection to the server persist until the process is completed. The entity returned with this response SHOULD include an indication of the request's current status and either a pointer to a status monitor or some estimate of when the user can expect the request to be fulfilled.
wiki.apache.org CommonHTTPStatusCodes:
There is also some information on this page.
Don't use 3xx status codes if there is activity on your page, (the page that is visited by your user) and you're NOT going to send them somewhere else by a redirection becouse the page content has not been moved. If it will take a long time to do the job on tour site you might want to ask your visitors to wait for the task and let them know by temporary wait messages or a progress bar..
I hope this will help you into the right direction