421

Misdirected Request

4xx Client Error The request was directed at a server that is not able to produce a response

Code Examples

Here are examples of how to test HTTP 200 responses in different programming languages:

Select options below to see how to use advanced features in your code:

Request:
curl https://free.mockerapi.com/421
Response Body:
{
  "success": false,
  "status": 421,
  "statusText": "Misdirected Request",
  "timestamp": "2025-10-08T10:30:45.123Z",
  "request": {
    "method": "GET",
    "url": "/421",
    "fullUrl": "https://free.mockerapi.com/421"
  }
}
Request:
fetch('https://free.mockerapi.com/421')
  .then(response => {
    console.log('Status:', response.status); // 421
    return response.json();
  })
  .then(data => {
    console.log('Success:', data);
  })
  .catch(error => {
    console.error('Error:', error);
  });
Response Body:
{
  "success": false,
  "status": 421,
  "statusText": "Misdirected Request",
  "timestamp": "2025-10-08T10:30:45.123Z",
  "request": {
    "method": "GET",
    "url": "/421",
    "fullUrl": "https://free.mockerapi.com/421"
  }
}
Request:
import requests

response = requests.get('https://free.mockerapi.com/421')

print(f'Status Code: {response.status_code}')  # 421
print(f'Response: {response.json()}')
Response Body:
{
  "success": false,
  "status": 421,
  "statusText": "Misdirected Request",
  "timestamp": "2025-10-08T10:30:45.123Z",
  "request": {
    "method": "GET",
    "url": "/421",
    "fullUrl": "https://free.mockerapi.com/421"
  }
}
Request:
Response Body:
{
  "success": false,
  "status": 421,
  "statusText": "Misdirected Request",
  "timestamp": "2025-10-08T10:30:45.123Z",
  "request": {
    "method": "GET",
    "url": "/421",
    "fullUrl": "https://free.mockerapi.com/421"
  }
}
Request:
require 'net/http'
require 'json'

uri = URI('https://free.mockerapi.com/421')
response = Net::HTTP.get_response(uri)

puts "Status Code: #{response.code}"  # 421
puts "Response: #{JSON.parse(response.body)}"
Response Body:
{
  "success": false,
  "status": 421,
  "statusText": "Misdirected Request",
  "timestamp": "2025-10-08T10:30:45.123Z",
  "request": {
    "method": "GET",
    "url": "/421",
    "fullUrl": "https://free.mockerapi.com/421"
  }
}
Request:
package main

import (
    "fmt"
    "io"
    "net/http"
)

func main() {
    resp, err := http.Get("https://free.mockerapi.com/421")
    if err != nil {
        panic(err)
    }
    defer resp.Body.Close()

    fmt.Printf("Status Code: %d\n", resp.StatusCode)  // 421

    body, err := io.ReadAll(resp.Body)
    if err != nil {
        panic(err)
    }

    fmt.Printf("Response: %s\n", body)
}
Response Body:
{
  "success": false,
  "status": 421,
  "statusText": "Misdirected Request",
  "timestamp": "2025-10-08T10:30:45.123Z",
  "request": {
    "method": "GET",
    "url": "/421",
    "fullUrl": "https://free.mockerapi.com/421"
  }
}
Request:
import java.net.http.*;
import java.net.URI;

public class HttpStatusTest {
    public static void main(String[] args) throws Exception {
        HttpClient client = HttpClient.newHttpClient();
        HttpRequest request = HttpRequest.newBuilder()
            .uri(URI.create("https://free.mockerapi.com/421"))
            .GET()
            .build();

        HttpResponse response = client.send(request,
            HttpResponse.BodyHandlers.ofString());

        System.out.println("Status Code: " + response.statusCode());  // 421
        System.out.println("Response: " + response.body());
    }
}
Response Body:
{
  "success": false,
  "status": 421,
  "statusText": "Misdirected Request",
  "timestamp": "2025-10-08T10:30:45.123Z",
  "request": {
    "method": "GET",
    "url": "/421",
    "fullUrl": "https://free.mockerapi.com/421"
  }
}
Request:
const https = require('https');

https.get('https://free.mockerapi.com/421', (res) => {
  console.log('Status Code:', res.statusCode);  // 421

  let data = '';

  res.on('data', (chunk) => {
    data += chunk;
  });

  res.on('end', () => {
    console.log('Response:', JSON.parse(data));
  });
}).on('error', (err) => {
  console.error('Error:', err.message);
});
Response Body:
{
  "success": false,
  "status": 421,
  "statusText": "Misdirected Request",
  "timestamp": "2025-10-08T10:30:45.123Z",
  "request": {
    "method": "GET",
    "url": "/421",
    "fullUrl": "https://free.mockerapi.com/421"
  }
}

What is HTTP 421 Misdirected Request?

HTTP 421 Misdirected Request is the standard response for successful HTTP requests. It indicates that the request was received, understood, and accepted by the server. The actual response will depend on the request method used:

  • GET: The resource has been fetched and transmitted in the message body
  • POST: The resource describing the result of the action is transmitted in the message body
  • PUT: The resource has been successfully updated
  • DELETE: The resource has been successfully deleted

When Does This Happen?

A 421 Misdirected Request response is returned when the server successfully processes a request without any errors. This is the most common successful status code and indicates that everything went as expected. You'll see this status code when:

  • Successfully fetching data from an API endpoint
  • Successfully creating a new resource (though 201 Created is more specific)
  • Successfully updating an existing resource
  • Successfully processing a form submission
  • Successfully executing any valid HTTP request that doesn't require a more specific success code

Try It Live

Click the button below to make a live request and see the 421 Misdirected Request response

Common Use Cases

✅ API Success Testing

Test how your application handles successful API responses and ensures proper data parsing and display.

🔄 Integration Testing

Mock successful responses in integration tests without needing a real backend service running.

🎨 Frontend Development

Develop and test UI components that display data from successful API calls before the backend is ready.

⏱️ Timeout Testing

Use the delay feature to test loading states, spinners, and timeout handling in your application.

📝 Documentation Examples

Provide working examples in API documentation that developers can test immediately.

🔍 Monitoring & Health Checks

Use as a test endpoint for monitoring systems, uptime checks, and health check implementations.

Related Success Status Codes