HTTP 449 Retry With (Microsoft)
Overview
The HTTP ~449 Retry With~ status code is specific to Microsoft’s Internet Information Services (IIS). It is used to indicate that the request should be retried after performing an action. This status code is typically utilized when the server requires additional information or when a specific action needs to be completed before the request can succeed.
Purpose
The HTTP 449 response informs the client that the requested action cannot be completed in its current form, and the client is encouraged to retry the request after fulfilling certain conditions or requirements specified by the server.
Usage
Server Behavior:
- Request Modification Required: The server requires the client to modify the request or take additional actions.
- Retry Instruction: The server includes information or instructions for the client to retry the request.
Scenarios
- Additional Information Required: When the server needs additional information from the client to fulfill the request.
- Action Required Before Retry: Indicates that a specific action must be performed before the client retries the request.
Curl Request and Response Example
Sending a request to a server that returns HTTP 449:
curl -i http://example.com/resource
# Expected behavior: HTTP/1.1 449 Retry With
# Additional information or instructions for the client.
PHP cURL Request and Response Example
PHP script using cURL to handle a situation where the server sends HTTP 449:
<?php
$ch = curl_init('http://example.com/resource');
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$response = curl_exec($ch);
if (curl_getinfo($ch, CURLINFO_HTTP_CODE) == 449) {
echo "Retry With: Additional information or instructions for the client.";
}
curl_close($ch);
?>
Python Request and Response Example
Python script to handle a situation where the server sends HTTP 449:
import requests
response = requests.get('http://example.com/resource')
if response.status_code == 449:
print("Retry With:", response.text)
Apache Configuration for HTTP 449 Retry With
Configuring Apache to return HTTP 449 for specific conditions:
<VirtualHost *:80>
ServerName example.com
# Additional configurations as needed
# ...
</VirtualHost>
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteCond %{SOME_CONDITION_TO_RETURN_449}
RewriteRule ^ - [R=449,L]
</IfModule>
NGINX Configuration for HTTP 449 Retry With
Setting up NGINX to return HTTP 449 for specific conditions:
server {
listen 80;
server_name example.com;
# Additional configurations as needed
# ...
if (SOME_CONDITION_TO_RETURN_449) {
return 449;
}
}
HTTP 444 No Response (Nginx) HTTP 450 Blocked by Windows Parental Controls (Microsoft)