425

Too Early

Official
Server does not want to process the request yet

Specification of the HTTP status code 425

A 425 Too Early status code indicates that the server is unwilling to risk processing a request that might be replayed.

User agents that send a request in early data are expected to retry the request when receiving a 425 Too Early response status code. A user agent SHOULD retry automatically, but any retries MUST NOT be sent in early data.

In all cases, an intermediary can forward a 425 Too Early status code. Intermediaries MUST forward a 425 Too Early status code if the request that it received and forwarded contained an Early-Data header field. Otherwise, an intermediary that receives a request in early data MAY automatically retry that request in response to a 425 Too Early status code, but it MUST wait for the TLS handshake to complete on the connection where it received the request.

The server cannot assume that a client is able to retry a request unless the request is received in early data or the Early-Data header field is set to "1". A server SHOULD NOT emit the 425 Too Early status code unless one of these conditions is met.

The 425 Too Early status code is not cacheable by default. Its payload is not the representation of any identified resource.

Source / Quote by: The 425 Too Early HTTP Status Code is specified by section 5.2 of RFC4918.

HTTP-Protocol

work in progress

How to throw a 425 statuscode with PHP?

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

Test the 425 HTTP status code

In order to be able to display the HTTP status code (in this case 425 Too Early) 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 425 Too Early
Overview
URL: https://http-statuscode.com/errorCodeExample.php?code=425
Status: 425 Too Early
Those: Network
IP address: XX.XX.XX.XX
Status code 425 Too Early

How to create a custom error page for the 425 status code

Creating your own 425 Too Early error page is relatively easy with the web server "Apache" as well as with the web server "NGINX".

Apache Webserver

The web server "Apache" is one of the most popular web servers on the Internet. To create an own 425 Too Early error page in "Apache", the following change must be made in the following file.

File: .htaccess
ErrorDocument 425 /errors/425.html

NGINX Webserver

Similar to the web server "Apache", "NGINX" is also widely used on the Internet. To create your own 425 Too Early error page in "NGINX", the following change must be made in the following file.

File: sites-enabled/default
error_page 425 /425.html;
location = /425.html {
    root /usr/share/nginx/html;
    internal;
}

Browser compatibility of the 425 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

http.StatusTooEarly
Response::HTTP_TOO_EARLY
:too_early
Author: Tony Brüser
Author: Tony Brüser

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

LinkedInGitHub