New in 2.4: Test runs you can trust See what's new →

Send a truncated body, then drop the connection

GEThttps://api.testingapis.com/api/chaos/partial

<b>Warning:</b> this endpoint deliberately drops the connection. It promises a 10KB body (Content-Length: 10000), sends about 70 bytes of incomplete JSON, then disconnects. Clients should report an incomplete or truncated response.

Responses

200
Headers are sent, but the body is incomplete and the connection is dropped.

Example

Request
curl -X GET "https://api.testingapis.com/api/chaos/partial"
Run in Studio
Response
The server sends status and headers plus part of the body, then drops the connection. Clients see a truncated or failed read.

Code examples

JavaScript (fetch)
const response = await fetch("https://api.testingapis.com/api/chaos/partial");
console.log(response.status, await response.text());
Python (requests)
import requests

response = requests.request(
    "GET",
    "https://api.testingapis.com/api/chaos/partial",
    allow_redirects=False,
)
print(response.status_code, response.text)
Java (HttpClient)
import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;

public class Main {
    public static void main(String[] args) throws Exception {
        HttpClient client = HttpClient.newBuilder()
            .followRedirects(HttpClient.Redirect.NEVER)
            .build();

        HttpRequest request = HttpRequest.newBuilder()
            .uri(URI.create("https://api.testingapis.com/api/chaos/partial"))
            .method("GET", HttpRequest.BodyPublishers.noBody())
            .build();

        HttpResponse<String> response = client.send(request, HttpResponse.BodyHandlers.ofString());
        System.out.println(response.statusCode() + " " + response.body());
    }
}