>_ RESTERM
v1.18.2

examples Start here

transport.http

Timeout, proxy, and @no-log samples. The timeout request fails on purpose, and the local mock stands in for the proxy.

start the local mock first

shell
resterm _examples/transport.http

Run this from the root of a clone of the Resterm repository.

Editor
# Start the mock in this file first with `resterm mock _examples/transport.http`,
# or open this file in the TUI and press `g Shift+M`.

### Fast Timeout
# @name TimeoutDemo
# @tag transport timeout
# @description Demonstrates @timeout to fail fast on slow responses.
# This request fails on purpose. The 2s timeout ends it before the 5s delay is over.
# @timeout 2s
GET {{base.url}}/delay/5
Accept: application/json

### Custom Transport Options
# @name CustomTransport
# @tag transport settings
# @description Shows proxy and redirect overrides.
# The local mock answers as the proxy, so example.invalid never has to resolve.
# @setting followredirects false
# @setting proxy {{transport.proxy}}
# @assert response.json().via == "resterm mock"
GET http://example.invalid/ping
Accept: */*

### Sensitive Payload With No Logging
# @name NoLogExample
# @tag transport privacy
# @description Prevents body snippets from landing in history.
# @no-log
# @setting timeout 4s
POST {{services.billing.base}}/secrets
Content-Type: application/json
Accept: application/json

{
  "secret": "{{$uuid}}",
  "source": "transport demo"
}

### Proxy reply
# @mock method=GET path=/ping
HTTP/1.1 200 OK
Content-Type: application/json

{"via":"resterm mock"}

_examples/transport.http on GitHub

HTTP transport and settings docs
Search

↑↓ moveEnter openEsc close

Help

These keys work like the ones in the TUI.

/
Search the docs (also Ctrl K)
j k
Scroll down and up
g g G
Jump to the top or the bottom
[ ]
Previous and next page
g d
Docs index
g h
Home page
t
Switch between dark and light
?
Show this help
Esc
Close a dialog