SIP

407 Proxy Authentication Required Yanıtını Taklit Et

The client must first authenticate with the proxy. The proxy returns a Proxy-Authenticate header with a challenge.

Tam referansı görüntüle →

1 HTTP Yanıtı

HTTP Yanıtı
HTTP/1.1 407 Proxy Authentication Required
Content-Type: application/json
Date: Tue, 25 Feb 2026 12:00:00 GMT
Content-Length: 86

{
  "error": "proxy_authentication_required",
  "message": "Proxy Authentication Required"
}

2 curl ile test et

terminal
curl -i https://httpbin.org/status/407

3 Framework'ünüzde 407 Proxy Authentication Required Döndürün

django
from django.http import JsonResponse


def my_view(request):
    return JsonResponse(
        {"error": "proxy_authentication_required", "message": "Proxy Authentication Required"},
        status=407,
    )
flask
from flask import Flask, jsonify

app = Flask(__name__)


@app.route("/endpoint")
def my_endpoint():
    return jsonify({"error": "proxy_authentication_required", "message": "Proxy Authentication Required"}), 407
fastapi
from fastapi import FastAPI
from fastapi.responses import JSONResponse

app = FastAPI()


@app.get("/endpoint")
def my_endpoint():
    return JSONResponse(
        content={"error": "proxy_authentication_required", "message": "Proxy Authentication Required"},
        status_code=407,
    )
express.js
// Express.js
app.get('/endpoint', (req, res) => {
  res.status(407).json({"error": "proxy_authentication_required", "message": "Proxy Authentication Required"});
});
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(407)
            .body(Map.of("error", "proxy_authentication_required",
                         "message", "Proxy Authentication Required"));
    }
}
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(407)
    json.NewEncoder(w).Encode(map[string]string{
        "error":   "proxy_authentication_required",
        "message": "Proxy Authentication Required",
    })
}
ruby on rails
class MyController < ApplicationController
  def my_action
    render json: {"error": "proxy_authentication_required", "message": "Proxy Authentication Required"},
           status: :proxy_authentication_required
  end
end
asp.net core
// ASP.NET Core Minimal API
app.MapGet("/endpoint", () =>
    Results.Json(
        new { error = "proxy_authentication_required", message = "Proxy Authentication Required" },
        statusCode: 407
    )
);

Daha Fazla SIP Mock Sayfası