SIP
420 Bad Extension रिस्पॉन्स का मॉक
The server did not understand the protocol extension specified in a Require or Proxy-Require header. The Unsupported header lists the unknown extensions.
पूर्ण संदर्भ देखें →1 HTTP रिस्पॉन्स
HTTP/1.1 420 Bad Extension
Content-Type: application/json
Date: Tue, 25 Feb 2026 12:00:00 GMT
Content-Length: 54
{
"error": "bad_extension",
"message": "Bad Extension"
}
2 curl से परीक्षण करें
curl -i https://httpbin.org/status/420
3 अपने फ्रेमवर्क में 420 Bad Extension वापस करें
django
from django.http import JsonResponse
def my_view(request):
return JsonResponse(
{"error": "bad_extension", "message": "Bad Extension"},
status=420,
)
flask
from flask import Flask, jsonify
app = Flask(__name__)
@app.route("/endpoint")
def my_endpoint():
return jsonify({"error": "bad_extension", "message": "Bad Extension"}), 420
fastapi
from fastapi import FastAPI
from fastapi.responses import JSONResponse
app = FastAPI()
@app.get("/endpoint")
def my_endpoint():
return JSONResponse(
content={"error": "bad_extension", "message": "Bad Extension"},
status_code=420,
)
express.js
// Express.js
app.get('/endpoint', (req, res) => {
res.status(420).json({"error": "bad_extension", "message": "Bad Extension"});
});
spring boot
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.*;
import java.util.Map;
@RestController
public class MyController {
@GetMapping("/endpoint")
public ResponseEntity<Map<String, Object>> myEndpoint() {
return ResponseEntity
.status(420)
.body(Map.of("error", "bad_extension",
"message", "Bad Extension"));
}
}
go net/http
package main
import (
"encoding/json"
"net/http"
)
func myHandler(w http.ResponseWriter, r *http.Request) {
w.Header().Set("Content-Type", "application/json")
w.WriteHeader(420)
json.NewEncoder(w).Encode(map[string]string{
"error": "bad_extension",
"message": "Bad Extension",
})
}
ruby on rails
class MyController < ApplicationController
def my_action
render json: {"error": "bad_extension", "message": "Bad Extension"},
status: :bad_extension
end
end
asp.net core
// ASP.NET Core Minimal API
app.MapGet("/endpoint", () =>
Results.Json(
new { error = "bad_extension", message = "Bad Extension" },
statusCode: 420
)
);