SMTP
Giả lập phản hồi 504 Parameter Not Implemented
A command parameter is not implemented on this server. The command itself is valid but the specific parameter or extension you used is not supported.
Xem tài liệu tham khảo đầy đủ →1 Phản hồi HTTP
HTTP/1.1 504 Parameter Not Implemented
Content-Type: application/json
Date: Tue, 25 Feb 2026 12:00:00 GMT
Content-Length: 68
{
"error": "gateway_timeout",
"message": "Upstream server timed out"
}
2 Kiểm tra với curl
curl -i https://httpbin.org/status/504
3 Trả về 504 Parameter Not Implemented trong Framework của bạn
django
from django.http import JsonResponse
def my_view(request):
return JsonResponse(
{"error": "gateway_timeout", "message": "Upstream server timed out"},
status=504,
)
flask
from flask import Flask, jsonify
app = Flask(__name__)
@app.route("/endpoint")
def my_endpoint():
return jsonify({"error": "gateway_timeout", "message": "Upstream server timed out"}), 504
fastapi
from fastapi import FastAPI
from fastapi.responses import JSONResponse
app = FastAPI()
@app.get("/endpoint")
def my_endpoint():
return JSONResponse(
content={"error": "gateway_timeout", "message": "Upstream server timed out"},
status_code=504,
)
express.js
// Express.js
app.get('/endpoint', (req, res) => {
res.status(504).json({"error": "gateway_timeout", "message": "Upstream server timed out"});
});
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(504)
.body(Map.of("error", "parameter_not_implemented",
"message", "Parameter Not Implemented"));
}
}
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(504)
json.NewEncoder(w).Encode(map[string]string{
"error": "parameter_not_implemented",
"message": "Parameter Not Implemented",
})
}
ruby on rails
class MyController < ApplicationController
def my_action
render json: {"error": "gateway_timeout", "message": "Upstream server timed out"},
status: :parameter_not_implemented
end
end
asp.net core
// ASP.NET Core Minimal API
app.MapGet("/endpoint", () =>
Results.Json(
new { error = "parameter_not_implemented", message = "Parameter Not Implemented" },
statusCode: 504
)
);