gRPC

Mock Respons 1 CANCELLED

The operation was cancelled, typically by the caller.

Lihat referensi lengkap →

1 Respons HTTP

Respons HTTP
HTTP/1.1 1 CANCELLED
Content-Type: application/json
Date: Tue, 25 Feb 2026 12:00:00 GMT

2 Uji dengan curl

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

3 Kembalikan 1 CANCELLED di Framework Anda

django
from django.http import HttpResponse


def my_view(request):
    return HttpResponse(status=1)  # CANCELLED
flask
from flask import Flask

app = Flask(__name__)


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

app = FastAPI()


@app.get("/endpoint")
def my_endpoint():
    return Response(status_code=1)  # CANCELLED
express.js
// Express.js
app.get('/endpoint', (req, res) => {
  res.sendStatus(1); // CANCELLED
});
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(1) // CANCELLED
            .build();
    }
}
go net/http
package main

import "net/http"

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

Halaman Mock gRPC Lainnya