200 OK
API v1build 72f6f92 · updated

HTTP Request & Response Service

Inspect requests, test responses, and debug integrations.

For random strings and IDs, try rand.hacks.run.

Base URL

https://200ok.hacks.run

Output

Plain text is returned by default. Use ?json for compact JSON or ?pretty for formatted JSON. Flags are enabled by their presence, regardless of value. ?pretty takes priority over ?json.

Run locally
docker run --rm -p 3000:3000 ghcr.io/teplostanski/200ok:latest

http://localhost:3000

JSON nesting defaults to 64 object or array levels. For deeper local tests, set JSON_MAX_DEPTH between 1 and 512. The 100 KiB body limit still applies.

docker run --rm -e JSON_MAX_DEPTH=256 -p 3000:3000 ghcr.io/teplostanski/200ok:latest

Status

HTTP status code reference
GETPOSTPUTPATCHDELETE

Returns the selected HTTP status code and its reason phrase.

Details

Request examples

GET

curl https://200ok.hacks.run/status/200

Responses

200 OK

The response body contains the requested code and its reason phrase, including for 1xx. Example: 200 OK.

Example · text/plain

200 OK

IP

/ip

Output
GET

The client’s IP address (IPv4 or IPv6).

Details

Request examples

GET

curl https://200ok.hacks.run/ip

Responses

200 OK

The client’s IP address (IPv4 or IPv6).

Example · text/plain

192.0.2.1

/ip/v4

Output
GET

The client’s IPv4 address.

Details

Request examples

GET

curl https://200ok.hacks.run/ip/v4

Responses

200 OK

The client connection address. This example uses a documentation IP. If the address family does not match the endpoint, the response is unknown in text and null in JSON.

Example · text/plain

192.0.2.1

/ip/v6

Output
GET

The client’s IPv6 address.

Details

Request examples

GET

curl https://200ok.hacks.run/ip/v6

Responses

200 OK

The client connection address. This example uses a documentation IP. If the address family does not match the endpoint, the response is unknown in text and null in JSON.

Example · text/plain

2001:db8::1

Echo

/echo

Output
GETPOSTPUTPATCHDELETE

Returns the request method and body. Accepts JSON, plain text, URL-encoded forms, and binary data.

Details

Request examples

POST · JSON

curl https://200ok.hacks.run/echo \
  -H 'Content-Type: application/json' \
  --data-binary '{"name":"Bob"}'

POST · Plain text

curl https://200ok.hacks.run/echo \
  -H 'Content-Type: text/plain' \
  --data-binary 'Hello!'

POST · Form

curl https://200ok.hacks.run/echo \
  --data-urlencode 'name=Bob' \
  --data-urlencode 'age=42'

POST · Binary file

curl https://200ok.hacks.run/echo \
  -H 'Content-Type: application/octet-stream' \
  --data-binary '@./file.bin'

Responses

200 OK

The method and parsed request body. This example is a GET request without a body.

Example · text/plain

GET

null
413 Payload Too Large

The body exceeds 102,400 bytes (100 KiB).

Example · text/plain

Request body exceeds the size limit of 100 KiB
415 Unsupported Media Type

An unsupported or missing Content-Type for a nonempty body.

Example · text/plain

Unsupported Content-Type. Supported: application/json, text/plain, application/x-www-form-urlencoded, application/octet-stream

Invalid JSON returns 400. API errors use the selected output format: plain text or JSON.

Headers

/headers

Output
GET

Incoming request headers.

Details

Request examples

With a custom header

curl https://200ok.hacks.run/headers \
  -H 'X-Test: hello'

Responses

200 OK

Incoming request headers. Names and values depend on the client.

Example · text/plain

host:  localhost:3000

accept:  */*