The sent request has been accepted, but not yet processed

Specification of the HTTP status code 202

The 202 Accepted status code indicates that 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 in HTTP for re-sending a status code from an asynchronous operation. The 202 Accepted response is intentionally noncommittal.

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 representation sent with this response ought to describe the request's current status and point to (or embed) a status monitor that can provide the user with an estimate of when the request will be fulfilled.

Source / Quote by: The 202 Accepted HTTP Status Code is specified by section 6.3.3 of RFC7231.

How to throw a 202 statuscode with PHP?

To throw the HTTP status code 202 on a web page, the PHP function http_response_code can be used. The syntax is as follows: http_response_code(202) (PHP 5 >= 5.4.0, PHP 7, PHP 8)

Test the 202 HTTP status code

In order to be able to display the HTTP status code (in this case 202 Accepted) and other information on the client side, the development console must be opened with F12. Afterwards you have to navigate to the tab "Network". Now you can open the page, in the network tab you should see the web page (example index.php). This must be selected and then the Herder section must be selected. Here the user will see the following result:

Status code 202 Accepted
URL: https://http-statuscode.com/errorCodeExample.php?code=202
Status: 202 Accepted
Those: Network
IP address: XX.XX.XX.XX
Status code 202 Accepted

Browser compatibility of the 202 status code

Chrome no data
Edge no data
Firefox no data
Opera no data
Safari no data
Chrome Android no data
Firefox for Android no data
Opera Android no data
Safari on iOS no data
Internet no data
WebView Android no data

Constants in programming languages

Author: Tony Brüser
Author: Tony Brüser

Tony Brüser is an enthusiastic web developer with a penchant for HTTP status codes.