Mock HTTP API
v2.0.0A simple HTTP server that can be used to mock HTTP responses for testing purposes. Inspired by httpbin and built using nodejs and fastify with the idea of running it via https://mockhttp.org, via docker jaredwray/mockhttp, or nodejs npm install @jaredwray/mockhttp.
About mockhttp.org
mockhttp.org is a free hosted instance of this codebase for testing. It runs on a Cloudflare Worker (no containers): documentation is served from Workers Assets, and mock APIs such as /get and /post run in the Worker. The service is globally available and rate-limited (1000 requests per minute per IP) to prevent abuse.
HTTP Methods
Returns request information for GET requests
{
"method": "string",
"headers": {},
"queryParams": {}
}
curl -X GET "/get"
const response = await fetch('/get', {
method: 'GET'
});
const data = await response.json();
import requests
response = requests.get('/get')
data = response.json()
Handles a POST request and returns request information
{
"key": "value"
}
{
"method": "string",
"headers": {},
"body": {
"key": "value"
}
}
curl -X POST "/post" \
-H "Content-Type: application/json" \
-d '{ "key": "value"}'
const response = await fetch('/post', {
method: 'POST',
headers: {
'Content-Type': 'application/json'
},
body: JSON.stringify({ "key": "value"})
});
const data = await response.json();
import requests
response = requests.post(
'/post',
headers={
'Content-Type': 'application/json'
},
json={ "key": "value"}
)
data = response.json()
Handles a DELETE request and returns request information
{
"method": "string",
"headers": {},
"body": null
}
curl -X DELETE "/delete"
const response = await fetch('/delete', {
method: 'DELETE'
});
const data = await response.json();
import requests
response = requests.delete('/delete')
data = response.json()
Handles a PUT request and returns request information
{
"key": "value"
}
{
"method": "string",
"headers": {},
"body": {
"key": "value"
}
}
curl -X PUT "/put" \
-H "Content-Type: application/json" \
-d '{ "key": "value"}'
const response = await fetch('/put', {
method: 'PUT',
headers: {
'Content-Type': 'application/json'
},
body: JSON.stringify({ "key": "value"})
});
const data = await response.json();
import requests
response = requests.put(
'/put',
headers={
'Content-Type': 'application/json'
},
json={ "key": "value"}
)
data = response.json()
Handles a PATCH request and returns request information
{
"key": "value"
}
{
"method": "string",
"headers": {},
"body": {
"key": "value"
}
}
curl -X PATCH "/patch" \
-H "Content-Type: application/json" \
-d '{ "key": "value"}'
const response = await fetch('/patch', {
method: 'PATCH',
headers: {
'Content-Type': 'application/json'
},
body: JSON.stringify({ "key": "value"})
});
const data = await response.json();
import requests
response = requests.patch(
'/patch',
headers={
'Content-Type': 'application/json'
},
json={ "key": "value"}
)
data = response.json()
Status Codes
Return status code or random status code if more than one are given
| Name | Type | In | Description |
|---|---|---|---|
| code * | string | path | HTTP status code to be returned |
{
"status": "string"
}
curl -X GET "/status/{code}?"
const response = await fetch('/status/{code}?', {
method: 'GET'
});
const data = await response.json();
import requests
response = requests.get('/status/{code}?')
data = response.json()
Return status code or random status code if more than one are given
| Name | Type | In | Description |
|---|---|---|---|
| code * | string | path | HTTP status code to be returned |
{
"status": "string"
}
curl -X POST "/status/{code}?"
const response = await fetch('/status/{code}?', {
method: 'POST'
});
const data = await response.json();
import requests
response = requests.post('/status/{code}?')
data = response.json()
Return status code or random status code if more than one are given
| Name | Type | In | Description |
|---|---|---|---|
| code * | string | path | HTTP status code to be returned |
{
"status": "string"
}
curl -X PUT "/status/{code}?"
const response = await fetch('/status/{code}?', {
method: 'PUT'
});
const data = await response.json();
import requests
response = requests.put('/status/{code}?')
data = response.json()
Return status code or random status code if more than one are given
| Name | Type | In | Description |
|---|---|---|---|
| code * | string | path | HTTP status code to be returned |
{
"status": "string"
}
curl -X DELETE "/status/{code}?"
const response = await fetch('/status/{code}?', {
method: 'DELETE'
});
const data = await response.json();
import requests
response = requests.delete('/status/{code}?')
data = response.json()
Return status code or random status code if more than one are given
| Name | Type | In | Description |
|---|---|---|---|
| code * | string | path | HTTP status code to be returned |
{
"status": "string"
}
curl -X PATCH "/status/{code}?"
const response = await fetch('/status/{code}?', {
method: 'PATCH'
});
const data = await response.json();
import requests
response = requests.patch('/status/{code}?')
data = response.json()
Request Inspection
Returns the IP address of the client
{
"ip": "string"
}
curl -X GET "/ip"
const response = await fetch('/ip', {
method: 'GET'
});
const data = await response.json();
import requests
response = requests.get('/ip')
data = response.json()
Returns all headers of the client request
{
"headers": {}
}
curl -X GET "/headers"
const response = await fetch('/headers', {
method: 'GET'
});
const data = await response.json();
import requests
response = requests.get('/headers')
data = response.json()
Returns the User-Agent header of the client request
{
"userAgent": "string"
}
curl -X GET "/user-agent"
const response = await fetch('/user-agent', {
method: 'GET'
});
const data = await response.json();
import requests
response = requests.get('/user-agent')
data = response.json()
Response Inspection
Handles cache validation and retrieval.
"string"
curl -X GET "/cache"
const response = await fetch('/cache', {
method: 'GET'
});
const data = await response.json();
import requests
response = requests.get('/cache')
data = response.json()
Sets a Cache-Control header for n seconds.
| Name | Type | In | Description |
|---|---|---|---|
| value * | integer | path | Number of seconds to cache the resource. |
"string"
curl -X GET "/cache/{value}"
const response = await fetch('/cache/{value}', {
method: 'GET'
});
const data = await response.json();
import requests
response = requests.get('/cache/{value}')
data = response.json()
Handles ETag-based conditional requests.
| Name | Type | In | Description |
|---|---|---|---|
| etag * | string | path | The ETag value for the resource. |
"string"
curl -X GET "/etag/{etag}"
const response = await fetch('/etag/{etag}', {
method: 'GET'
});
const data = await response.json();
import requests
response = requests.get('/etag/{etag}')
data = response.json()
Returns a set of response headers based on the query string.
| Name | Type | In | Description |
|---|---|---|---|
| type | object | query | |
| additionalProperties | object | query | |
| description | object | query |
{
"key": "value"
}
curl -X GET "/response-headers?type={type}&additionalProperties={additionalProperties}&description={description}"
const response = await fetch('/response-headers?type={type}&additionalProperties={additionalProperties}&description={description}', {
method: 'GET'
});
const data = await response.json();
import requests
response = requests.get(
'/response-headers',
params={
'type': '{type}',
'additionalProperties': '{additionalProperties}',
'description': '{description}'
}
)
data = response.json()
Returns a set of response headers based on the query string.
| Name | Type | In | Description |
|---|---|---|---|
| type | object | query | |
| additionalProperties | object | query | |
| description | object | query |
{
"key": "value"
}
curl -X POST "/response-headers?type={type}&additionalProperties={additionalProperties}&description={description}"
const response = await fetch('/response-headers?type={type}&additionalProperties={additionalProperties}&description={description}', {
method: 'POST'
});
const data = await response.json();
import requests
response = requests.post(
'/response-headers',
params={
'type': '{type}',
'additionalProperties': '{additionalProperties}',
'description': '{description}'
}
)
data = response.json()
Response Formats
Returns plain text content. A random template is selected unless a 1-based template index is provided (e.g. /plain/1) for stable output.
| Name | Type | In | Description |
|---|---|---|---|
| index * | string | path | Optional 1-based template index for stable, repeatable output. Omit for a random template. |
"string"
{
"error": "string"
}
curl -X GET "/plain/{index}?"
const response = await fetch('/plain/{index}?', {
method: 'GET'
});
const data = await response.json();
import requests
response = requests.get('/plain/{index}?')
data = response.json()
Returns plain text content. A random template is selected unless a 1-based template index is provided (e.g. /plain/1) for stable output.
| Name | Type | In | Description |
|---|---|---|---|
| index * | string | path | Optional 1-based template index for stable, repeatable output. Omit for a random template. |
"string"
{
"error": "string"
}
curl -X POST "/plain/{index}?"
const response = await fetch('/plain/{index}?', {
method: 'POST'
});
const data = await response.json();
import requests
response = requests.post('/plain/{index}?')
data = response.json()
Returns plain text content. A random template is selected unless a 1-based template index is provided (e.g. /plain/1) for stable output.
| Name | Type | In | Description |
|---|---|---|---|
| index * | string | path | Optional 1-based template index for stable, repeatable output. Omit for a random template. |
"string"
{
"error": "string"
}
curl -X PUT "/plain/{index}?"
const response = await fetch('/plain/{index}?', {
method: 'PUT'
});
const data = await response.json();
import requests
response = requests.put('/plain/{index}?')
data = response.json()
Returns plain text content. A random template is selected unless a 1-based template index is provided (e.g. /plain/1) for stable output.
| Name | Type | In | Description |
|---|---|---|---|
| index * | string | path | Optional 1-based template index for stable, repeatable output. Omit for a random template. |
"string"
{
"error": "string"
}
curl -X DELETE "/plain/{index}?"
const response = await fetch('/plain/{index}?', {
method: 'DELETE'
});
const data = await response.json();
import requests
response = requests.delete('/plain/{index}?')
data = response.json()
Returns plain text content. A random template is selected unless a 1-based template index is provided (e.g. /plain/1) for stable output.
| Name | Type | In | Description |
|---|---|---|---|
| index * | string | path | Optional 1-based template index for stable, repeatable output. Omit for a random template. |
"string"
{
"error": "string"
}
curl -X PATCH "/plain/{index}?"
const response = await fetch('/plain/{index}?', {
method: 'PATCH'
});
const data = await response.json();
import requests
response = requests.patch('/plain/{index}?')
data = response.json()
Returns text content. A random template is selected unless a 1-based template index is provided (e.g. /text/1) for stable output.
| Name | Type | In | Description |
|---|---|---|---|
| index * | string | path | Optional 1-based template index for stable, repeatable output. Omit for a random template. |
"string"
{
"error": "string"
}
curl -X GET "/text/{index}?"
const response = await fetch('/text/{index}?', {
method: 'GET'
});
const data = await response.json();
import requests
response = requests.get('/text/{index}?')
data = response.json()
Returns text content. A random template is selected unless a 1-based template index is provided (e.g. /text/1) for stable output.
| Name | Type | In | Description |
|---|---|---|---|
| index * | string | path | Optional 1-based template index for stable, repeatable output. Omit for a random template. |
"string"
{
"error": "string"
}
curl -X POST "/text/{index}?"
const response = await fetch('/text/{index}?', {
method: 'POST'
});
const data = await response.json();
import requests
response = requests.post('/text/{index}?')
data = response.json()
Returns text content. A random template is selected unless a 1-based template index is provided (e.g. /text/1) for stable output.
| Name | Type | In | Description |
|---|---|---|---|
| index * | string | path | Optional 1-based template index for stable, repeatable output. Omit for a random template. |
"string"
{
"error": "string"
}
curl -X PUT "/text/{index}?"
const response = await fetch('/text/{index}?', {
method: 'PUT'
});
const data = await response.json();
import requests
response = requests.put('/text/{index}?')
data = response.json()
Returns text content. A random template is selected unless a 1-based template index is provided (e.g. /text/1) for stable output.
| Name | Type | In | Description |
|---|---|---|---|
| index * | string | path | Optional 1-based template index for stable, repeatable output. Omit for a random template. |
"string"
{
"error": "string"
}
curl -X DELETE "/text/{index}?"
const response = await fetch('/text/{index}?', {
method: 'DELETE'
});
const data = await response.json();
import requests
response = requests.delete('/text/{index}?')
data = response.json()
Returns text content. A random template is selected unless a 1-based template index is provided (e.g. /text/1) for stable output.
| Name | Type | In | Description |
|---|---|---|---|
| index * | string | path | Optional 1-based template index for stable, repeatable output. Omit for a random template. |
"string"
{
"error": "string"
}
curl -X PATCH "/text/{index}?"
const response = await fetch('/text/{index}?', {
method: 'PATCH'
});
const data = await response.json();
import requests
response = requests.patch('/text/{index}?')
data = response.json()
Returns HTML content. A random template is selected unless a 1-based template index is provided (e.g. /html/1) for stable output.
| Name | Type | In | Description |
|---|---|---|---|
| index * | string | path | Optional 1-based template index for stable, repeatable output. Omit for a random template. |
"string"
{
"error": "string"
}
curl -X GET "/html/{index}?"
const response = await fetch('/html/{index}?', {
method: 'GET'
});
const data = await response.json();
import requests
response = requests.get('/html/{index}?')
data = response.json()
Returns HTML content. A random template is selected unless a 1-based template index is provided (e.g. /html/1) for stable output.
| Name | Type | In | Description |
|---|---|---|---|
| index * | string | path | Optional 1-based template index for stable, repeatable output. Omit for a random template. |
"string"
{
"error": "string"
}
curl -X POST "/html/{index}?"
const response = await fetch('/html/{index}?', {
method: 'POST'
});
const data = await response.json();
import requests
response = requests.post('/html/{index}?')
data = response.json()
Returns HTML content. A random template is selected unless a 1-based template index is provided (e.g. /html/1) for stable output.
| Name | Type | In | Description |
|---|---|---|---|
| index * | string | path | Optional 1-based template index for stable, repeatable output. Omit for a random template. |
"string"
{
"error": "string"
}
curl -X PUT "/html/{index}?"
const response = await fetch('/html/{index}?', {
method: 'PUT'
});
const data = await response.json();
import requests
response = requests.put('/html/{index}?')
data = response.json()
Returns HTML content. A random template is selected unless a 1-based template index is provided (e.g. /html/1) for stable output.
| Name | Type | In | Description |
|---|---|---|---|
| index * | string | path | Optional 1-based template index for stable, repeatable output. Omit for a random template. |
"string"
{
"error": "string"
}
curl -X DELETE "/html/{index}?"
const response = await fetch('/html/{index}?', {
method: 'DELETE'
});
const data = await response.json();
import requests
response = requests.delete('/html/{index}?')
data = response.json()
Returns HTML content. A random template is selected unless a 1-based template index is provided (e.g. /html/1) for stable output.
| Name | Type | In | Description |
|---|---|---|---|
| index * | string | path | Optional 1-based template index for stable, repeatable output. Omit for a random template. |
"string"
{
"error": "string"
}
curl -X PATCH "/html/{index}?"
const response = await fetch('/html/{index}?', {
method: 'PATCH'
});
const data = await response.json();
import requests
response = requests.patch('/html/{index}?')
data = response.json()
Returns XML content. A random template is selected unless a 1-based template index is provided (e.g. /xml/1) for stable output.
| Name | Type | In | Description |
|---|---|---|---|
| index * | string | path | Optional 1-based template index for stable, repeatable output. Omit for a random template. |
"string"
{
"error": "string"
}
curl -X GET "/xml/{index}?"
const response = await fetch('/xml/{index}?', {
method: 'GET'
});
const data = await response.json();
import requests
response = requests.get('/xml/{index}?')
data = response.json()
Returns XML content. A random template is selected unless a 1-based template index is provided (e.g. /xml/1) for stable output.
| Name | Type | In | Description |
|---|---|---|---|
| index * | string | path | Optional 1-based template index for stable, repeatable output. Omit for a random template. |
"string"
{
"error": "string"
}
curl -X POST "/xml/{index}?"
const response = await fetch('/xml/{index}?', {
method: 'POST'
});
const data = await response.json();
import requests
response = requests.post('/xml/{index}?')
data = response.json()
Returns XML content. A random template is selected unless a 1-based template index is provided (e.g. /xml/1) for stable output.
| Name | Type | In | Description |
|---|---|---|---|
| index * | string | path | Optional 1-based template index for stable, repeatable output. Omit for a random template. |
"string"
{
"error": "string"
}
curl -X PUT "/xml/{index}?"
const response = await fetch('/xml/{index}?', {
method: 'PUT'
});
const data = await response.json();
import requests
response = requests.put('/xml/{index}?')
data = response.json()
Returns XML content. A random template is selected unless a 1-based template index is provided (e.g. /xml/1) for stable output.
| Name | Type | In | Description |
|---|---|---|---|
| index * | string | path | Optional 1-based template index for stable, repeatable output. Omit for a random template. |
"string"
{
"error": "string"
}
curl -X DELETE "/xml/{index}?"
const response = await fetch('/xml/{index}?', {
method: 'DELETE'
});
const data = await response.json();
import requests
response = requests.delete('/xml/{index}?')
data = response.json()
Returns XML content. A random template is selected unless a 1-based template index is provided (e.g. /xml/1) for stable output.
| Name | Type | In | Description |
|---|---|---|---|
| index * | string | path | Optional 1-based template index for stable, repeatable output. Omit for a random template. |
"string"
{
"error": "string"
}
curl -X PATCH "/xml/{index}?"
const response = await fetch('/xml/{index}?', {
method: 'PATCH'
});
const data = await response.json();
import requests
response = requests.patch('/xml/{index}?')
data = response.json()
Returns JSON content. A random template is selected unless a 1-based template index is provided (e.g. /json/1) for stable output.
| Name | Type | In | Description |
|---|---|---|---|
| index * | string | path | Optional 1-based template index for stable, repeatable output. Omit for a random template. |
{
"key": "value"
}
{
"error": "string"
}
curl -X GET "/json/{index}?"
const response = await fetch('/json/{index}?', {
method: 'GET'
});
const data = await response.json();
import requests
response = requests.get('/json/{index}?')
data = response.json()
Returns JSON content. A random template is selected unless a 1-based template index is provided (e.g. /json/1) for stable output.
| Name | Type | In | Description |
|---|---|---|---|
| index * | string | path | Optional 1-based template index for stable, repeatable output. Omit for a random template. |
{
"key": "value"
}
{
"error": "string"
}
curl -X POST "/json/{index}?"
const response = await fetch('/json/{index}?', {
method: 'POST'
});
const data = await response.json();
import requests
response = requests.post('/json/{index}?')
data = response.json()
Returns JSON content. A random template is selected unless a 1-based template index is provided (e.g. /json/1) for stable output.
| Name | Type | In | Description |
|---|---|---|---|
| index * | string | path | Optional 1-based template index for stable, repeatable output. Omit for a random template. |
{
"key": "value"
}
{
"error": "string"
}
curl -X PUT "/json/{index}?"
const response = await fetch('/json/{index}?', {
method: 'PUT'
});
const data = await response.json();
import requests
response = requests.put('/json/{index}?')
data = response.json()
Returns JSON content. A random template is selected unless a 1-based template index is provided (e.g. /json/1) for stable output.
| Name | Type | In | Description |
|---|---|---|---|
| index * | string | path | Optional 1-based template index for stable, repeatable output. Omit for a random template. |
{
"key": "value"
}
{
"error": "string"
}
curl -X DELETE "/json/{index}?"
const response = await fetch('/json/{index}?', {
method: 'DELETE'
});
const data = await response.json();
import requests
response = requests.delete('/json/{index}?')
data = response.json()
Returns JSON content. A random template is selected unless a 1-based template index is provided (e.g. /json/1) for stable output.
| Name | Type | In | Description |
|---|---|---|---|
| index * | string | path | Optional 1-based template index for stable, repeatable output. Omit for a random template. |
{
"key": "value"
}
{
"error": "string"
}
curl -X PATCH "/json/{index}?"
const response = await fetch('/json/{index}?', {
method: 'PATCH'
});
const data = await response.json();
import requests
response = requests.patch('/json/{index}?')
data = response.json()
Returns page denied by robots.txt rules
"string"
curl -X GET "/deny"
const response = await fetch('/deny', {
method: 'GET'
});
const data = await response.json();
import requests
response = requests.get('/deny')
data = response.json()
Returns page denied by robots.txt rules
"string"
curl -X POST "/deny"
const response = await fetch('/deny', {
method: 'POST'
});
const data = await response.json();
import requests
response = requests.post('/deny')
data = response.json()
Returns page denied by robots.txt rules
"string"
curl -X PUT "/deny"
const response = await fetch('/deny', {
method: 'PUT'
});
const data = await response.json();
import requests
response = requests.put('/deny')
data = response.json()
Returns page denied by robots.txt rules
"string"
curl -X DELETE "/deny"
const response = await fetch('/deny', {
method: 'DELETE'
});
const data = await response.json();
import requests
response = requests.delete('/deny')
data = response.json()
Returns page denied by robots.txt rules
"string"
curl -X PATCH "/deny"
const response = await fetch('/deny', {
method: 'PATCH'
});
const data = await response.json();
import requests
response = requests.patch('/deny')
data = response.json()
Returns GZip-encoded data
"string"
curl -X GET "/gzip"
const response = await fetch('/gzip', {
method: 'GET'
});
const data = await response.json();
import requests
response = requests.get('/gzip')
data = response.json()
Returns GZip-encoded data
"string"
curl -X POST "/gzip"
const response = await fetch('/gzip', {
method: 'POST'
});
const data = await response.json();
import requests
response = requests.post('/gzip')
data = response.json()
Returns GZip-encoded data
"string"
curl -X PUT "/gzip"
const response = await fetch('/gzip', {
method: 'PUT'
});
const data = await response.json();
import requests
response = requests.put('/gzip')
data = response.json()
Returns GZip-encoded data
"string"
curl -X DELETE "/gzip"
const response = await fetch('/gzip', {
method: 'DELETE'
});
const data = await response.json();
import requests
response = requests.delete('/gzip')
data = response.json()
Returns GZip-encoded data
"string"
curl -X PATCH "/gzip"
const response = await fetch('/gzip', {
method: 'PATCH'
});
const data = await response.json();
import requests
response = requests.patch('/gzip')
data = response.json()
Returns Deflate-encoded data
"string"
curl -X GET "/deflate"
const response = await fetch('/deflate', {
method: 'GET'
});
const data = await response.json();
import requests
response = requests.get('/deflate')
data = response.json()
Returns Deflate-encoded data
"string"
curl -X POST "/deflate"
const response = await fetch('/deflate', {
method: 'POST'
});
const data = await response.json();
import requests
response = requests.post('/deflate')
data = response.json()
Returns Deflate-encoded data
"string"
curl -X PUT "/deflate"
const response = await fetch('/deflate', {
method: 'PUT'
});
const data = await response.json();
import requests
response = requests.put('/deflate')
data = response.json()
Returns Deflate-encoded data
"string"
curl -X DELETE "/deflate"
const response = await fetch('/deflate', {
method: 'DELETE'
});
const data = await response.json();
import requests
response = requests.delete('/deflate')
data = response.json()
Returns Deflate-encoded data
"string"
curl -X PATCH "/deflate"
const response = await fetch('/deflate', {
method: 'PATCH'
});
const data = await response.json();
import requests
response = requests.patch('/deflate')
data = response.json()
Returns Brotli-encoded data
"string"
curl -X GET "/brotli"
const response = await fetch('/brotli', {
method: 'GET'
});
const data = await response.json();
import requests
response = requests.get('/brotli')
data = response.json()
Returns Brotli-encoded data
"string"
curl -X POST "/brotli"
const response = await fetch('/brotli', {
method: 'POST'
});
const data = await response.json();
import requests
response = requests.post('/brotli')
data = response.json()
Returns Brotli-encoded data
"string"
curl -X PUT "/brotli"
const response = await fetch('/brotli', {
method: 'PUT'
});
const data = await response.json();
import requests
response = requests.put('/brotli')
data = response.json()
Returns Brotli-encoded data
"string"
curl -X DELETE "/brotli"
const response = await fetch('/brotli', {
method: 'DELETE'
});
const data = await response.json();
import requests
response = requests.delete('/brotli')
data = response.json()
Returns Brotli-encoded data
"string"
curl -X PATCH "/brotli"
const response = await fetch('/brotli', {
method: 'PATCH'
});
const data = await response.json();
import requests
response = requests.patch('/brotli')
data = response.json()
Redirects
Redirects the request to the target URL using an absolute URL
| Name | Type | In | Description |
|---|---|---|---|
| value * | integer | path | |
| host * | string | header |
"string"
curl -X GET "/absolute-redirect/{value}" \
-H "host: {host}"
const response = await fetch('/absolute-redirect/{value}', {
method: 'GET',
headers: {
'host': '{host}'
}
});
const data = await response.json();
import requests
response = requests.get(
'/absolute-redirect/{value}',
headers={
'host': '{host}'
}
)
data = response.json()
Redirects the request to the target URL using an relative URL
| Name | Type | In | Description |
|---|---|---|---|
| value * | integer | path | |
| host * | string | header |
"string"
curl -X GET "/relative-redirect/{value}" \
-H "host: {host}"
const response = await fetch('/relative-redirect/{value}', {
method: 'GET',
headers: {
'host': '{host}'
}
});
const data = await response.json();
import requests
response = requests.get(
'/relative-redirect/{value}',
headers={
'host': '{host}'
}
)
data = response.json()
Redirects the request to the target URL
| Name | Type | In | Description |
|---|---|---|---|
| url * | string (uri) | query | The URL to redirect to |
| status_code | string | query | The HTTP status code to use for redirection |
curl -X GET "/redirect-to?url={url}&status_code={status_code}"
const response = await fetch('/redirect-to?url={url}&status_code={status_code}', {
method: 'GET'
});
const data = await response.json();
import requests
response = requests.get(
'/redirect-to',
params={
'url': '{url}',
'status_code': '{status_code}'
}
)
data = response.json()
Redirects the request to the target URL
| Name | Type | In | Description |
|---|---|---|---|
| url * | string (uri) | query | The URL to redirect to |
| status_code | string | query | The HTTP status code to use for redirection |
curl -X POST "/redirect-to?url={url}&status_code={status_code}"
const response = await fetch('/redirect-to?url={url}&status_code={status_code}', {
method: 'POST'
});
const data = await response.json();
import requests
response = requests.post(
'/redirect-to',
params={
'url': '{url}',
'status_code': '{status_code}'
}
)
data = response.json()
Redirects the request to the target URL
| Name | Type | In | Description |
|---|---|---|---|
| url * | string (uri) | query | The URL to redirect to |
| status_code | string | query | The HTTP status code to use for redirection |
curl -X PUT "/redirect-to?url={url}&status_code={status_code}"
const response = await fetch('/redirect-to?url={url}&status_code={status_code}', {
method: 'PUT'
});
const data = await response.json();
import requests
response = requests.put(
'/redirect-to',
params={
'url': '{url}',
'status_code': '{status_code}'
}
)
data = response.json()
Redirects the request to the target URL
| Name | Type | In | Description |
|---|---|---|---|
| url * | string (uri) | query | The URL to redirect to |
| status_code | string | query | The HTTP status code to use for redirection |
curl -X DELETE "/redirect-to?url={url}&status_code={status_code}"
const response = await fetch('/redirect-to?url={url}&status_code={status_code}', {
method: 'DELETE'
});
const data = await response.json();
import requests
response = requests.delete(
'/redirect-to',
params={
'url': '{url}',
'status_code': '{status_code}'
}
)
data = response.json()
Redirects the request to the target URL
| Name | Type | In | Description |
|---|---|---|---|
| url * | string (uri) | query | The URL to redirect to |
| status_code | string | query | The HTTP status code to use for redirection |
curl -X PATCH "/redirect-to?url={url}&status_code={status_code}"
const response = await fetch('/redirect-to?url={url}&status_code={status_code}', {
method: 'PATCH'
});
const data = await response.json();
import requests
response = requests.patch(
'/redirect-to',
params={
'url': '{url}',
'status_code': '{status_code}'
}
)
data = response.json()
Cookies
Return cookies from the request
{
"cookies": {}
}
curl -X GET "/cookies"
const response = await fetch('/cookies', {
method: 'GET'
});
const data = await response.json();
import requests
response = requests.get('/cookies')
data = response.json()
Set a cookie
{
"name": "string",
"value": "string",
"expires": "string"
}
{
"cookies": {}
}
curl -X POST "/cookies" \
-H "Content-Type: application/json" \
-d '{ "name": "string", "value": "string", "expires": "string"}'
const response = await fetch('/cookies', {
method: 'POST',
headers: {
'Content-Type': 'application/json'
},
body: JSON.stringify({ "name": "string", "value": "string", "expires": "string"})
});
const data = await response.json();
import requests
response = requests.post(
'/cookies',
headers={
'Content-Type': 'application/json'
},
json={ "name": "string", "value": "string", "expires": "string"}
)
data = response.json()
Delete a cookie
| Name | Type | In | Description |
|---|---|---|---|
| name * | string | query |
curl -X DELETE "/cookies?name={name}"
const response = await fetch('/cookies?name={name}', {
method: 'DELETE'
});
const data = await response.json();
import requests
response = requests.delete(
'/cookies',
params={
'name': '{name}'
}
)
data = response.json()
Anything
Will return anything that you send it
{
"args": {
"key": "value"
},
"data": {
"key": "value"
},
"files": {
"key": "value"
},
"form": {
"key": "value"
},
"headers": {
"key": "value"
},
"json": {
"key": "value"
},
"method": "string",
"origin": "string",
"url": "string"
}
curl -X GET "/anything"
const response = await fetch('/anything', {
method: 'GET'
});
const data = await response.json();
import requests
response = requests.get('/anything')
data = response.json()
Will return anything that you send it
{
"args": {
"key": "value"
},
"data": {
"key": "value"
},
"files": {
"key": "value"
},
"form": {
"key": "value"
},
"headers": {
"key": "value"
},
"json": {
"key": "value"
},
"method": "string",
"origin": "string",
"url": "string"
}
curl -X POST "/anything"
const response = await fetch('/anything', {
method: 'POST'
});
const data = await response.json();
import requests
response = requests.post('/anything')
data = response.json()
Will return anything that you send it
{
"args": {
"key": "value"
},
"data": {
"key": "value"
},
"files": {
"key": "value"
},
"form": {
"key": "value"
},
"headers": {
"key": "value"
},
"json": {
"key": "value"
},
"method": "string",
"origin": "string",
"url": "string"
}
curl -X PUT "/anything"
const response = await fetch('/anything', {
method: 'PUT'
});
const data = await response.json();
import requests
response = requests.put('/anything')
data = response.json()
Will return anything that you send it
{
"args": {
"key": "value"
},
"data": {
"key": "value"
},
"files": {
"key": "value"
},
"form": {
"key": "value"
},
"headers": {
"key": "value"
},
"json": {
"key": "value"
},
"method": "string",
"origin": "string",
"url": "string"
}
curl -X DELETE "/anything"
const response = await fetch('/anything', {
method: 'DELETE'
});
const data = await response.json();
import requests
response = requests.delete('/anything')
data = response.json()
Will return anything that you send it
{
"args": {
"key": "value"
},
"data": {
"key": "value"
},
"files": {
"key": "value"
},
"form": {
"key": "value"
},
"headers": {
"key": "value"
},
"json": {
"key": "value"
},
"method": "string",
"origin": "string",
"url": "string"
}
curl -X PATCH "/anything"
const response = await fetch('/anything', {
method: 'PATCH'
});
const data = await response.json();
import requests
response = requests.patch('/anything')
data = response.json()
Auth
HTTP Basic authentication. Succeeds only if the user/pass provided in the path matches the Basic Authorization header.
| Name | Type | In | Description |
|---|---|---|---|
| user * | string | path | |
| passwd * | string | path |
{
"authenticated": true,
"user": "string"
}
{
"message": "string"
}
curl -X GET "/basic-auth/{user}/{passwd}"
const response = await fetch('/basic-auth/{user}/{passwd}', {
method: 'GET'
});
const data = await response.json();
import requests
response = requests.get('/basic-auth/{user}/{passwd}')
data = response.json()
HTTP Bearer authentication. Succeeds if any Bearer token is present unless ?required=true is provided.
| Name | Type | In | Description |
|---|---|---|---|
| required | boolean | query |
{
"authenticated": true,
"token": "string"
}
{
"message": "string"
}
curl -X GET "/bearer?required={required}"
const response = await fetch('/bearer?required={required}', {
method: 'GET'
});
const data = await response.json();
import requests
response = requests.get(
'/bearer',
params={
'required': '{required}'
}
)
data = response.json()
HTTP Digest authentication. Mirrors httpbin behavior for testing clients.
| Name | Type | In | Description |
|---|---|---|---|
| qop * | string | path | |
| user * | string | path | |
| passwd * | string | path | |
| algorithm * | string | path | |
| stale_after * | string | path |
curl -X GET "/digest-auth/{qop}/{user}/{passwd}"
const response = await fetch('/digest-auth/{qop}/{user}/{passwd}', {
method: 'GET'
});
const data = await response.json();
import requests
response = requests.get('/digest-auth/{qop}/{user}/{passwd}')
data = response.json()
HTTP Digest authentication. Mirrors httpbin behavior for testing clients.
| Name | Type | In | Description |
|---|---|---|---|
| qop * | string | path | |
| user * | string | path | |
| passwd * | string | path | |
| algorithm * | string | path | |
| stale_after * | string | path |
curl -X GET "/digest-auth/{qop}/{user}/{passwd}/{algorithm}"
const response = await fetch('/digest-auth/{qop}/{user}/{passwd}/{algorithm}', {
method: 'GET'
});
const data = await response.json();
import requests
response = requests.get('/digest-auth/{qop}/{user}/{passwd}/{algorithm}')
data = response.json()
Images
Returns an image based on Accept header (supports jpeg, png, svg, webp)
| Name | Type | In | Description |
|---|---|---|---|
| accept | string | header | Accept header for content negotiation |
"string"
curl -X GET "/image" \
-H "accept: {accept}"
const response = await fetch('/image', {
method: 'GET',
headers: {
'accept': '{accept}'
}
});
const data = await response.json();
import requests
response = requests.get(
'/image',
headers={
'accept': '{accept}'
}
)
data = response.json()
Returns a JPEG image
"string"
curl -X GET "/image/jpeg"
const response = await fetch('/image/jpeg', {
method: 'GET'
});
const data = await response.json();
import requests
response = requests.get('/image/jpeg')
data = response.json()
Returns a PNG image
"string"
curl -X GET "/image/png"
const response = await fetch('/image/png', {
method: 'GET'
});
const data = await response.json();
import requests
response = requests.get('/image/png')
data = response.json()
Returns an SVG image
"string"
curl -X GET "/image/svg"
const response = await fetch('/image/svg', {
method: 'GET'
});
const data = await response.json();
import requests
response = requests.get('/image/svg')
data = response.json()
Returns a WEBP image
"string"
curl -X GET "/image/webp"
const response = await fetch('/image/webp', {
method: 'GET'
});
const data = await response.json();
import requests
response = requests.get('/image/webp')
data = response.json()
Dynamic Data
Return a UUID4
{
"uuid": "string"
}
curl -X GET "/uuid"
const response = await fetch('/uuid', {
method: 'GET'
});
const data = await response.json();
import requests
response = requests.get('/uuid')
data = response.json()
Returns n random bytes generated with given seed
| Name | Type | In | Description |
|---|---|---|---|
| seed | string | query | Seed for random number generation |
| n * | string | path | Number of bytes to generate |
"string"
{
"error": "string"
}
curl -X GET "/bytes/{n}?seed={seed}"
const response = await fetch('/bytes/{n}?seed={seed}', {
method: 'GET'
});
const data = await response.json();
import requests
response = requests.get(
'/bytes/{n}',
params={
'seed': '{seed}'
}
)
data = response.json()
Streams n random bytes generated with given seed, in chunks of chunk_size per packet
| Name | Type | In | Description |
|---|---|---|---|
| seed | string | query | Seed for random number generation |
| chunk_size | string | query | Size of each chunk (default: 10240) |
| n * | string | path | Number of bytes to stream |
"string"
{
"error": "string"
}
curl -X GET "/stream-bytes/{n}?seed={seed}&chunk_size={chunk_size}"
const response = await fetch('/stream-bytes/{n}?seed={seed}&chunk_size={chunk_size}', {
method: 'GET'
});
const data = await response.json();
import requests
response = requests.get(
'/stream-bytes/{n}',
params={
'seed': '{seed}',
'chunk_size': '{chunk_size}'
}
)
data = response.json()
Returns a delayed response (max of 10 seconds)
| Name | Type | In | Description |
|---|---|---|---|
| type | object | query | |
| additionalProperties | object | query | |
| delay * | string | path | Delay in seconds (max 10) |
{
"args": {},
"data": "string",
"files": {},
"form": {},
"headers": {},
"origin": "string",
"url": "string"
}
{
"error": "string"
}
curl -X GET "/delay/{delay}?type={type}&additionalProperties={additionalProperties}"
const response = await fetch('/delay/{delay}?type={type}&additionalProperties={additionalProperties}', {
method: 'GET'
});
const data = await response.json();
import requests
response = requests.get(
'/delay/{delay}',
params={
'type': '{type}',
'additionalProperties': '{additionalProperties}'
}
)
data = response.json()
Returns a delayed response (max of 10 seconds)
| Name | Type | In | Description |
|---|---|---|---|
| type | object | query | |
| additionalProperties | object | query | |
| delay * | string | path | Delay in seconds (max 10) |
{
"args": {},
"data": "string",
"files": {},
"form": {},
"headers": {},
"origin": "string",
"url": "string"
}
{
"error": "string"
}
curl -X POST "/delay/{delay}?type={type}&additionalProperties={additionalProperties}"
const response = await fetch('/delay/{delay}?type={type}&additionalProperties={additionalProperties}', {
method: 'POST'
});
const data = await response.json();
import requests
response = requests.post(
'/delay/{delay}',
params={
'type': '{type}',
'additionalProperties': '{additionalProperties}'
}
)
data = response.json()
Returns a delayed response (max of 10 seconds)
| Name | Type | In | Description |
|---|---|---|---|
| type | object | query | |
| additionalProperties | object | query | |
| delay * | string | path | Delay in seconds (max 10) |
{
"args": {},
"data": "string",
"files": {},
"form": {},
"headers": {},
"origin": "string",
"url": "string"
}
{
"error": "string"
}
curl -X PUT "/delay/{delay}?type={type}&additionalProperties={additionalProperties}"
const response = await fetch('/delay/{delay}?type={type}&additionalProperties={additionalProperties}', {
method: 'PUT'
});
const data = await response.json();
import requests
response = requests.put(
'/delay/{delay}',
params={
'type': '{type}',
'additionalProperties': '{additionalProperties}'
}
)
data = response.json()
Returns a delayed response (max of 10 seconds)
| Name | Type | In | Description |
|---|---|---|---|
| type | object | query | |
| additionalProperties | object | query | |
| delay * | string | path | Delay in seconds (max 10) |
{
"args": {},
"data": "string",
"files": {},
"form": {},
"headers": {},
"origin": "string",
"url": "string"
}
{
"error": "string"
}
curl -X DELETE "/delay/{delay}?type={type}&additionalProperties={additionalProperties}"
const response = await fetch('/delay/{delay}?type={type}&additionalProperties={additionalProperties}', {
method: 'DELETE'
});
const data = await response.json();
import requests
response = requests.delete(
'/delay/{delay}',
params={
'type': '{type}',
'additionalProperties': '{additionalProperties}'
}
)
data = response.json()
Returns a delayed response (max of 10 seconds)
| Name | Type | In | Description |
|---|---|---|---|
| type | object | query | |
| additionalProperties | object | query | |
| delay * | string | path | Delay in seconds (max 10) |
{
"args": {},
"data": "string",
"files": {},
"form": {},
"headers": {},
"origin": "string",
"url": "string"
}
{
"error": "string"
}
curl -X PATCH "/delay/{delay}?type={type}&additionalProperties={additionalProperties}"
const response = await fetch('/delay/{delay}?type={type}&additionalProperties={additionalProperties}', {
method: 'PATCH'
});
const data = await response.json();
import requests
response = requests.patch(
'/delay/{delay}',
params={
'type': '{type}',
'additionalProperties': '{additionalProperties}'
}
)
data = response.json()
Decodes base64url-encoded string
| Name | Type | In | Description |
|---|---|---|---|
| value * | string | path | Base64 encoded value to decode |
"string"
{
"error": "string"
}
curl -X GET "/base64/{value}"
const response = await fetch('/base64/{value}', {
method: 'GET'
});
const data = await response.json();
import requests
response = requests.get('/base64/{value}')
data = response.json()
Stream n JSON responses
| Name | Type | In | Description |
|---|---|---|---|
| n * | string | path | Number of JSON responses to stream (max 100) |
"string"
{
"error": "string"
}
curl -X GET "/stream/{n}"
const response = await fetch('/stream/{n}', {
method: 'GET'
});
const data = await response.json();
import requests
response = requests.get('/stream/{n}')
data = response.json()
Streams n random bytes generated, and supports HTTP Range requests
| Name | Type | In | Description |
|---|---|---|---|
| duration | string | query | Delay before sending response in seconds |
| numbytes * | string | path | Number of bytes available |
"string"
"string"
{
"error": "string"
}
{
"error": "string"
}
curl -X GET "/range/{numbytes}?duration={duration}"
const response = await fetch('/range/{numbytes}?duration={duration}', {
method: 'GET'
});
const data = await response.json();
import requests
response = requests.get(
'/range/{numbytes}',
params={
'duration': '{duration}'
}
)
data = response.json()
Drips data over a duration after an optional initial delay, then (optionally) returns with the given status code
| Name | Type | In | Description |
|---|---|---|---|
| duration | string | query | Duration in seconds over which to drip the data (default: 2) |
| numbytes | string | query | Number of bytes to send (default: 10) |
| code | string | query | HTTP status code to return (default: 200) |
| delay | string | query | Initial delay in seconds before starting (default: 2) |
"string"
{
"error": "string"
}
curl -X GET "/drip?duration={duration}&numbytes={numbytes}&code={code}&delay={delay}"
const response = await fetch('/drip?duration={duration}&numbytes={numbytes}&code={code}&delay={delay}', {
method: 'GET'
});
const data = await response.json();
import requests
response = requests.get(
'/drip',
params={
'duration': '{duration}',
'numbytes': '{numbytes}',
'code': '{code}',
'delay': '{delay}'
}
)
data = response.json()
Generate a page containing n links to other pages which do the same
| Name | Type | In | Description |
|---|---|---|---|
| n * | string | path | Number of links to generate |
| offset * | string | path | Starting offset for pagination (default: 0) |
"string"
{
"error": "string"
}
curl -X GET "/links/{n}/{offset}?"
const response = await fetch('/links/{n}/{offset}?', {
method: 'GET'
});
const data = await response.json();
import requests
response = requests.get('/links/{n}/{offset}?')
data = response.json()
Bins
List all active bins
{
"bins": [
{
"id": "string",
"createdAt": "string",
"expiresAt": "string",
"requestCount": 0
}
]
}
curl -X GET "/bins"
const response = await fetch('/bins', {
method: 'GET'
});
const data = await response.json();
import requests
response = requests.get('/bins')
data = response.json()
Create a new request bin
{
"id": "string",
"url": "string",
"createdAt": "string",
"expiresAt": "string",
"requestCount": 0
}
curl -X POST "/bins"
const response = await fetch('/bins', {
method: 'POST'
});
const data = await response.json();
import requests
response = requests.post('/bins')
data = response.json()
Get metadata for a single bin
| Name | Type | In | Description |
|---|---|---|---|
| id * | string | path |
{
"id": "string",
"createdAt": "string",
"expiresAt": "string",
"requestCount": 0
}
{
"error": "string"
}
curl -X GET "/bins/{id}"
const response = await fetch('/bins/{id}', {
method: 'GET'
});
const data = await response.json();
import requests
response = requests.get('/bins/{id}')
data = response.json()
Delete a bin and all its captured requests
| Name | Type | In | Description |
|---|---|---|---|
| id * | string | path |
{
"error": "string"
}
curl -X DELETE "/bins/{id}"
const response = await fetch('/bins/{id}', {
method: 'DELETE'
});
const data = await response.json();
import requests
response = requests.delete('/bins/{id}')
data = response.json()
List captured requests for a bin (newest first)
| Name | Type | In | Description |
|---|---|---|---|
| id * | string | path |
{
"requests": [
{
"id": "string",
"binId": "string",
"method": "string",
"url": "string",
"path": "string",
"query": {
"key": "value"
},
"headers": {
"key": "value"
},
"remoteAddress": "string",
"contentType": "string",
"bodySize": 0,
"body": null,
"bodyEncoding": "utf8",
"truncated": true,
"capturedAt": "string"
}
]
}
{
"error": "string"
}
curl -X GET "/bins/{id}/requests"
const response = await fetch('/bins/{id}/requests', {
method: 'GET'
});
const data = await response.json();
import requests
response = requests.get('/bins/{id}/requests')
data = response.json()
Clear all captured requests for a bin
| Name | Type | In | Description |
|---|---|---|---|
| id * | string | path |
{
"error": "string"
}
curl -X DELETE "/bins/{id}/requests"
const response = await fetch('/bins/{id}/requests', {
method: 'DELETE'
});
const data = await response.json();
import requests
response = requests.delete('/bins/{id}/requests')
data = response.json()
Get a single captured request by id
| Name | Type | In | Description |
|---|---|---|---|
| id * | string | path | |
| reqId * | string | path |
{
"id": "string",
"binId": "string",
"method": "string",
"url": "string",
"path": "string",
"query": {
"key": "value"
},
"headers": {
"key": "value"
},
"remoteAddress": "string",
"contentType": "string",
"bodySize": 0,
"body": null,
"bodyEncoding": "utf8",
"truncated": true,
"capturedAt": "string"
}
{
"error": "string"
}
curl -X GET "/bins/{id}/requests/{reqId}"
const response = await fetch('/bins/{id}/requests/{reqId}', {
method: 'GET'
});
const data = await response.json();
import requests
response = requests.get('/bins/{id}/requests/{reqId}')
data = response.json()
Capture any HTTP request sent to a bin. Stores method, headers, body, query, and metadata.
| Name | Type | In | Description |
|---|---|---|---|
| id * | string | path | Bin identifier |
| * * | string | path | Sub-path captured with the request |
{
"ok": true,
"binId": "string",
"requestId": "string"
}
{
"error": "string"
}
curl -X GET "/b/{id}"
const response = await fetch('/b/{id}', {
method: 'GET'
});
const data = await response.json();
import requests
response = requests.get('/b/{id}')
data = response.json()
Capture any HTTP request sent to a bin. Stores method, headers, body, query, and metadata.
| Name | Type | In | Description |
|---|---|---|---|
| id * | string | path | Bin identifier |
| * * | string | path | Sub-path captured with the request |
{
"ok": true,
"binId": "string",
"requestId": "string"
}
{
"error": "string"
}
curl -X POST "/b/{id}"
const response = await fetch('/b/{id}', {
method: 'POST'
});
const data = await response.json();
import requests
response = requests.post('/b/{id}')
data = response.json()
Capture any HTTP request sent to a bin. Stores method, headers, body, query, and metadata.
| Name | Type | In | Description |
|---|---|---|---|
| id * | string | path | Bin identifier |
| * * | string | path | Sub-path captured with the request |
{
"ok": true,
"binId": "string",
"requestId": "string"
}
{
"error": "string"
}
curl -X PUT "/b/{id}"
const response = await fetch('/b/{id}', {
method: 'PUT'
});
const data = await response.json();
import requests
response = requests.put('/b/{id}')
data = response.json()
Capture any HTTP request sent to a bin. Stores method, headers, body, query, and metadata.
| Name | Type | In | Description |
|---|---|---|---|
| id * | string | path | Bin identifier |
| * * | string | path | Sub-path captured with the request |
{
"ok": true,
"binId": "string",
"requestId": "string"
}
{
"error": "string"
}
curl -X DELETE "/b/{id}"
const response = await fetch('/b/{id}', {
method: 'DELETE'
});
const data = await response.json();
import requests
response = requests.delete('/b/{id}')
data = response.json()
Capture any HTTP request sent to a bin. Stores method, headers, body, query, and metadata.
| Name | Type | In | Description |
|---|---|---|---|
| id * | string | path | Bin identifier |
| * * | string | path | Sub-path captured with the request |
{
"ok": true,
"binId": "string",
"requestId": "string"
}
{
"error": "string"
}
curl -X PATCH "/b/{id}"
const response = await fetch('/b/{id}', {
method: 'PATCH'
});
const data = await response.json();
import requests
response = requests.patch('/b/{id}')
data = response.json()
Capture any HTTP request sent to a bin. Stores method, headers, body, query, and metadata.
| Name | Type | In | Description |
|---|---|---|---|
| id * | string | path | Bin identifier |
| * * | string | path | Sub-path captured with the request |
{
"ok": true,
"binId": "string",
"requestId": "string"
}
{
"error": "string"
}
curl -X OPTIONS "/b/{id}"
const response = await fetch('/b/{id}', {
method: 'OPTIONS'
});
const data = await response.json();
import requests
response = requests.options('/b/{id}')
data = response.json()
Capture any HTTP request sent to a bin. Stores method, headers, body, query, and metadata.
| Name | Type | In | Description |
|---|---|---|---|
| id * | string | path | Bin identifier |
| * * | string | path | Sub-path captured with the request |
{
"ok": true,
"binId": "string",
"requestId": "string"
}
{
"error": "string"
}
curl -X GET "/b/{id}/{*}"
const response = await fetch('/b/{id}/{*}', {
method: 'GET'
});
const data = await response.json();
import requests
response = requests.get('/b/{id}/{*}')
data = response.json()
Capture any HTTP request sent to a bin. Stores method, headers, body, query, and metadata.
| Name | Type | In | Description |
|---|---|---|---|
| id * | string | path | Bin identifier |
| * * | string | path | Sub-path captured with the request |
{
"ok": true,
"binId": "string",
"requestId": "string"
}
{
"error": "string"
}
curl -X POST "/b/{id}/{*}"
const response = await fetch('/b/{id}/{*}', {
method: 'POST'
});
const data = await response.json();
import requests
response = requests.post('/b/{id}/{*}')
data = response.json()
Capture any HTTP request sent to a bin. Stores method, headers, body, query, and metadata.
| Name | Type | In | Description |
|---|---|---|---|
| id * | string | path | Bin identifier |
| * * | string | path | Sub-path captured with the request |
{
"ok": true,
"binId": "string",
"requestId": "string"
}
{
"error": "string"
}
curl -X PUT "/b/{id}/{*}"
const response = await fetch('/b/{id}/{*}', {
method: 'PUT'
});
const data = await response.json();
import requests
response = requests.put('/b/{id}/{*}')
data = response.json()
Capture any HTTP request sent to a bin. Stores method, headers, body, query, and metadata.
| Name | Type | In | Description |
|---|---|---|---|
| id * | string | path | Bin identifier |
| * * | string | path | Sub-path captured with the request |
{
"ok": true,
"binId": "string",
"requestId": "string"
}
{
"error": "string"
}
curl -X DELETE "/b/{id}/{*}"
const response = await fetch('/b/{id}/{*}', {
method: 'DELETE'
});
const data = await response.json();
import requests
response = requests.delete('/b/{id}/{*}')
data = response.json()
Capture any HTTP request sent to a bin. Stores method, headers, body, query, and metadata.
| Name | Type | In | Description |
|---|---|---|---|
| id * | string | path | Bin identifier |
| * * | string | path | Sub-path captured with the request |
{
"ok": true,
"binId": "string",
"requestId": "string"
}
{
"error": "string"
}
curl -X PATCH "/b/{id}/{*}"
const response = await fetch('/b/{id}/{*}', {
method: 'PATCH'
});
const data = await response.json();
import requests
response = requests.patch('/b/{id}/{*}')
data = response.json()
Capture any HTTP request sent to a bin. Stores method, headers, body, query, and metadata.
| Name | Type | In | Description |
|---|---|---|---|
| id * | string | path | Bin identifier |
| * * | string | path | Sub-path captured with the request |
{
"ok": true,
"binId": "string",
"requestId": "string"
}
{
"error": "string"
}
curl -X OPTIONS "/b/{id}/{*}"
const response = await fetch('/b/{id}/{*}', {
method: 'OPTIONS'
});
const data = await response.json();
import requests
response = requests.options('/b/{id}/{*}')
data = response.json()