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

Accepts only PUT and echoes the body

PUThttps://api.testingapis.com/api/methods/put

Request body

Optional. application/json. Optional body; described in the response.

Example body
{"a": 1}

Responses

200
Method, query, content type and body.
405
Any other verb.

Example

Request
curl -X PUT "https://api.testingapis.com/api/methods/put" \
  -H "Content-Type: application/json" \
  -d '{"a": 1}'
Run in Studio
Response200 OK
{
  "method": "PUT",
  "message": "PUT request received",
  "path": "/api/methods/put",
  "query": {},
  "contentType": "application/json",
  "bodyLength": 8,
  "bodyTruncated": false,
  "body": "{\"a\": 1}",
  "timestamp": "2026-09-30T18:26:44Z"
}

Code examples

JavaScript (fetch)
const response = await fetch("https://api.testingapis.com/api/methods/put", {
  method: "PUT",
  headers: {
    "Content-Type": "application/json",
  },
  body: "{\"a\": 1}",
});
console.log(response.status, await response.text());
Python (requests)
import requests

response = requests.request(
    "PUT",
    "https://api.testingapis.com/api/methods/put",
    headers={
        "Content-Type": "application/json",
    },
    data="{\"a\": 1}".encode("utf-8"),
    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/methods/put"))
            .header("Content-Type", "application/json")
            .method("PUT", HttpRequest.BodyPublishers.ofString("{\"a\": 1}"))
            .build();

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