FTP
451 Local Error 응답 모의 테스트
Requested action aborted: local error in processing. The server encountered an unexpected error while trying to complete the command.
전체 레퍼런스 보기 →1 HTTP 응답
HTTP/1.1 451 Local Error
Content-Type: application/json
Date: Tue, 25 Feb 2026 12:00:00 GMT
Content-Length: 50
{
"error": "local_error",
"message": "Local Error"
}
2 curl로 테스트하기
curl -i https://httpbin.org/status/451
3 프레임워크에서 451 Local Error 반환하기
django
from django.http import JsonResponse
def my_view(request):
return JsonResponse(
{"error": "local_error", "message": "Local Error"},
status=451,
)
flask
from flask import Flask, jsonify
app = Flask(__name__)
@app.route("/endpoint")
def my_endpoint():
return jsonify({"error": "local_error", "message": "Local Error"}), 451
fastapi
from fastapi import FastAPI
from fastapi.responses import JSONResponse
app = FastAPI()
@app.get("/endpoint")
def my_endpoint():
return JSONResponse(
content={"error": "local_error", "message": "Local Error"},
status_code=451,
)
express.js
// Express.js
app.get('/endpoint', (req, res) => {
res.status(451).json({"error": "local_error", "message": "Local Error"});
});
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(451)
.body(Map.of("error", "local_error",
"message", "Local Error"));
}
}
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(451)
json.NewEncoder(w).Encode(map[string]string{
"error": "local_error",
"message": "Local Error",
})
}
ruby on rails
class MyController < ApplicationController
def my_action
render json: {"error": "local_error", "message": "Local Error"},
status: :local_error
end
end
asp.net core
// ASP.NET Core Minimal API
app.MapGet("/endpoint", () =>
Results.Json(
new { error = "local_error", message = "Local Error" },
statusCode: 451
)
);