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

Return an object with awkward keys

GEThttps://api.testingapis.com/api/edge-cases/special-keys

Return an object with awkward keys: empty, dotted, __proto__, quoted, emoji and case variants.

Responses

200
Success.

Example

Request
curl -X GET "https://api.testingapis.com/api/edge-cases/special-keys"
Run in Studio
Response200 OK
{
  "": "empty key",
  " ": "space key",
  "key with spaces": 1,
  "key.with.dots": 2,
  "key-with-dashes": 3,
  "key_with_underscores": 4,
  "key/with/slashes": 5,
  "key[0]": 6,
  "123": "numeric key",
  "0": "zero key",
  "$ref": "#/definitions/user",
  "@type": "Person",
  "__proto__": {"polluted": true},
… (13 more lines)

Code examples

JavaScript (fetch)
const response = await fetch("https://api.testingapis.com/api/edge-cases/special-keys");
console.log(response.status, await response.text());
Python (requests)
import requests

response = requests.request(
    "GET",
    "https://api.testingapis.com/api/edge-cases/special-keys",
    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/edge-cases/special-keys"))
            .method("GET", HttpRequest.BodyPublishers.noBody())
            .build();

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