WebSocket

Mock 1001 Going Away Response

An endpoint is going away, such as a server shutting down or a browser navigating away from the page. The connection must be closed.

View full reference →

1 HTTP Response

HTTP Response
HTTP/1.1 1001 Going Away
Content-Type: application/json
Date: Tue, 25 Feb 2026 12:00:00 GMT

2 Test with curl

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

3 Return 1001 Going Away in Your Framework

django
from django.http import HttpResponse


def my_view(request):
    return HttpResponse(status=1001)  # Going Away
flask
from flask import Flask

app = Flask(__name__)


@app.route("/endpoint")
def my_endpoint():
    return "", 1001  # Going Away
fastapi
from fastapi import FastAPI
from fastapi.responses import Response

app = FastAPI()


@app.get("/endpoint")
def my_endpoint():
    return Response(status_code=1001)  # Going Away
express.js
// Express.js
app.get('/endpoint', (req, res) => {
  res.sendStatus(1001); // Going Away
});
spring boot
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.*;

@RestController
public class MyController {

    @GetMapping("/endpoint")
    public ResponseEntity<Void> myEndpoint() {
        return ResponseEntity
            .status(1001) // Going Away
            .build();
    }
}
go net/http
package main

import "net/http"

func myHandler(w http.ResponseWriter, r *http.Request) {
    w.WriteHeader(1001) // Going Away
}
ruby on rails
class MyController < ApplicationController
  def my_action
    head :going_away
  end
end
asp.net core
// ASP.NET Core Minimal API
app.MapGet("/endpoint", () =>
    Results.StatusCode(1001) // Going Away
);

More WebSocket Mock Pages