HTTP Response Backends
Create HTTP Response Backend
Request
POST /backends/http_response
Example Request
curl \
-X POST \
-H "Authorization: Bearer {API_KEY}" \
-H "Content-Type: application/json" \
-H "Ngrok-Version: 2" \
-d '{"body":"I'm a teapot","description":"acme http response","headers":{"Content-Type":"text/plain"},"metadata":"{\"environment\": \"staging\"}","status_code":418}' \
https://api.ngrok.com/backends/http_response
Parameters
Name | Type | Description |
---|---|---|
description | string | human-readable description of this backend. Optional |
metadata | string | arbitrary user-defined machine-readable data of this backend. Optional |
body | string | body to return as fixed content |
headers | Map<string, string> | headers to return |
status_code | int32 | status code to return |
Response
Returns a 201 response on success
Example Response
{
"body": "I'm a teapot",
"created_at": "2024-08-02T07:15:39Z",
"description": "acme http response",
"headers": {
"content-type": "text/plain"
},
"id": "bkdhr_2k5okJE9drRbPJ67P4Wvn28IgSn",
"metadata": "{\"environment\": \"staging\"}",
"status_code": 418,
"uri": "https://api.ngrok.com/backends/http_response/bkdhr_2k5okJE9drRbPJ67P4Wvn28IgSn"
}
Fields
Name | Type | Description |
---|---|---|
id | string | |
uri | string | URI of the HTTPResponseBackend API resource |
created_at | string | timestamp when the backend was created, RFC 3339 format |
description | string | human-readable description of this backend. Optional |
metadata | string | arbitrary user-defined machine-readable data of this backend. Optional |
body | string | body to return as fixed content |
headers | Map<string, string> | headers to return |
status_code | int32 | status code to return |
Delete HTTP Response Backend
Request
DELETE /backends/http_response/{id}