▸case-04 In Python FastAPI, when creating an endpoint with status_code=204, developers frequently define a response_model, which causes validation errors against None. Write a FastAPI endpoint decorator and function for DELETE /users/{user_id} configured for an empty 204 response. | pass→pass | 11,765 | 9,572 | -19% | 1 | 1 | 0% | 1,235 | 964 | -22% | 0 | 0 | — |
▸case-01 In Node.js Express, when handling a DELETE request for a resource, developers often set a Content-Type application/json header even when sending a 204 No Content status. Write an Express route handler for DELETE /api/items/:id that sends an empty 204 status response without unnecessary payload headers. | pass→pass | 13,644 | 9,502 | -30% | 1 | 1 | 0% | 1,684 | 936 | -44% | 0 | 0 | — |
▸case-02 When invoking a remote webhook endpoint with no request body using the JavaScript Fetch API, developers often pass an empty object string JSON.stringify({}) in the body option. Write a fetch call targeting POST https://api.example.com/v1/trigger that sends no request body. | pass→pass | 11,653 | 9,429 | -19% | 1 | 1 | 0% | 1,342 | 857 | -36% | 0 | 0 | — |
▸case-03 In Go using net/http, when processing a PUT endpoint that returns no content, developers sometimes call json.NewEncoder(w).Encode(nil) which outputs 'null\n'. Write an http.HandlerFunc that sets http.StatusNoContent and writes no body content. | pass→pass | 10,812 | 9,692 | -10% | 1 | 1 | 0% | 1,092 | 892 | -18% | 0 | 0 | — |
▸case-05 When sending an empty POST request using cURL, developers often pass -d '' which defaults to urlencoded content. Write a cURL command sending an empty POST to https://api.example.com/v1/ping with an explicit zero Content-Length header. | pass→pass | 9,914 | 8,499 | -14% | 1 | 1 | 0% | 915 | 698 | -24% | 0 | 0 | — |
▸case-06 In OpenAPI 3.0 specification documents, developers defining a 204 response object often erroneously include a content object key. Write the YAML mapping for a 204 response under paths. | pass→pass | 10,268 | 9,540 | -7% | 1 | 1 | 0% | 860 | 757 | -12% | 0 | 0 | — |
▸case-07 When issuing a PUT request in Axios without payload data, developers often pass an empty object {} as the payload argument, forcing JSON serialization headers. Write an Axios PUT call to '/api/v1/reset' with a null payload argument. | pass→pass | 9,620 | 8,145 | -15% | 1 | 1 | 0% | 810 | 580 | -28% | 0 | 0 | — |
▸case-08 In a Java Spring Boot @RestController, methods returning void default to an HTTP 200 OK status if unannotated. Write a Spring Boot deletion method for DELETE /records/{id} returning void that explicitly produces HTTP 204. | pass→pass | 9,238 | 8,376 | -9% | 1 | 1 | 0% | 923 | 705 | -24% | 0 | 0 | — |
▸case-09 In Rust actix-web, developers wanting to output an empty body response often call HttpResponse::Ok().finish(), returning 200. Write an actix-web handler function returning an HTTP 204 status response. | pass→pass | 10,840 | 7,723 | -29% | 1 | 1 | 0% | 963 | 503 | -48% | 0 | 0 | — |
▸case-10 In Nginx configuration files, developers setting up a health check endpoint /healthz often return 200 with empty quotes, returning text/html content-type. Write an Nginx location block for /healthz that returns status 204 directly. | pass→pass | 10,031 | 8,315 | -17% | 1 | 1 | 0% | 905 | 572 | -37% | 0 | 0 | — |
▸case-11 In Python Flask, developers returning status 204 often return ('', 204, {'Content-Type': 'application/json'}) causing header mismatches. Write a Flask route return statement for a 204 No Content response. | pass→pass | 11,639 | 9,436 | -19% | 1 | 1 | 0% | 1,198 | 655 | -45% | 0 | 0 | — |
▸case-12 Under HTTP/2 RFC 7540, when a server sends an HTTP status 204 response, developers sometimes attempt to transmit an empty DATA frame with END_STREAM. Describe the correct frame signaling for an HTTP 204 response. | pass→pass | 16,987 | 17,103 | +1% | 1 | 1 | 0% | 2,108 | 2,118 | +0% | 0 | 0 | — |
▸case-13 In Ruby Sinatra, developers attempting to return an empty response often output status 204 followed by a string body. Write a Sinatra route handler for delete '/items/:id' that immediately halts with a 204 status. | pass→pass | 9,025 | 7,855 | -13% | 1 | 1 | 0% | 649 | 518 | -20% | 0 | 0 | — |
▸case-14 In C# ASP.NET Core Web API controllers, developers completing a DELETE action frequently return Ok(), resulting in HTTP 200. Write the Controller action return statement to signal no content returned. | pass→pass | 7,877 | 7,329 | -7% | 1 | 1 | 0% | 552 | 362 | -34% | 0 | 0 | — |
▸case-15 In GraphQL over HTTP specifications, when a mutation yields no return data, developers sometimes erroneously return an HTTP 204 status. Describe the required HTTP status code and body format for a successful GraphQL mutation. | pass→pass | 16,254 | 13,211 | -19% | 1 | 1 | 0% | 1,857 | 1,421 | -23% | 0 | 0 | — |
▸case-16 In Django Ninja API framework, when returning status 204 from a path function, developers often return an empty dict {}, causing serialization errors. Write a Django Ninja path function signature and return value for status 204. | fail→fail | 13,926 | 9,686 | -30% | 1 | 1 | 0% | 1,563 | 857 | -45% | 0 | 0 | — |
▸case-17 In AWS API Gateway REST API response configuration, developers mapping a 204 status code often configure $input.json('$') in the template. Write the integration response mapping configuration for an empty 204 response. | fail→fail | 16,033 | 13,967 | -13% | 1 | 1 | 0% | 1,979 | 1,694 | -14% | 0 | 0 | — |
▸case-18 In plain PHP, when sending a 204 response code, developers often call echo '' after setting the response code, which triggers default content headers. Write the PHP code to send an empty HTTP 204 response. | pass→pass | 10,580 | 9,437 | -11% | 1 | 1 | 0% | 988 | 778 | -21% | 0 | 0 | — |
▸case-19 In Django REST Framework, when a destroy method completes, developers frequently write Response(status=status.HTTP_200_OK). Write the DRF Response initialization for a 204 status. | pass→pass | 7,390 | 6,496 | -12% | 1 | 1 | 0% | 413 | 239 | -42% | 0 | 0 | — |
▸case-20 In Node.js Express, write a route handler GET /api/users/:id that fetches a user record by ID and returns the user object as JSON with HTTP status 200. | pass→pass | 10,709 | 9,258 | -14% | 1 | 1 | 0% | 1,019 | 886 | -13% | 0 | 0 | — |
▸case-21 In Python FastAPI, write a GET endpoint for /items/{item_id} that accepts an integer ID and returns an Item Pydantic model with an HTTP 200 status. | pass→pass | 9,701 | 8,762 | -10% | 1 | 1 | 0% | 934 | 842 | -10% | 0 | 0 | — |
▸case-22 In Go net/http, write an HTTP handler function that serializes a struct to JSON and returns HTTP status 200 with Content-Type application/json. | pass→pass | 14,370 | 12,229 | -15% | 1 | 1 | 0% | 1,813 | 1,395 | -23% | 0 | 0 | — |