Examples
Clone the repository and run the commands from its root. Many examples read resterm.env.json or other files from their own folder, so a single downloaded file may not run on its own.
Get the files
git clone --depth 1 --branch v1.18.2 https://github.com/unkn0wn-root/resterm.git
cd restermStart here
- basic.httpA file-wide base URL, GET and POST, a binary download, time and random data helpers, and bearer auth. Its resterm.env.json holds the environments that most files in this folder use.
- nested.httpFile and request variables with nested environment values in a JSON body, with tags.
- service-groups.httpRequests grouped by tag, such as smoke checks and provisioning.
- xml.httpXML bodies and explicit inline angle-prefixed text.
- transport.httpTimeout, proxy, and @no-log samples. The timeout request fails on purpose, and the local mock stands in for the proxy.
Variables and auth
- scopes.httpGlobal, file, and request variables and captures, checked with @assert.
- auth_scopes.httpDefault auth inheritance across global, file and request scopes, plus @auth none.
- oauth2.httpCapturing a token by hand compared with the @auth oauth2 directive.
- auth_command.httpCommand-backed auth from gh auth token, with file defaults, named definitions with use=, @apply reuse, JSON output and custom headers. The mycli request needs a CLI of your own.
- grouped/grouped-environments.httpGrouped environments declared in their own resterm.env.json, with a mock backend that echoes what each request carried.
Scripts and checks
- scripts.httpA RestermScript pre-request block that sets a token, headers and body, then an @assert check.
- rts/rts_all_features.httpRestermScript expressions, modules, the standard library, @when, @skip-if, @for-each, and pre-request and test blocks.
- rts/apply_profiles.httpReusable @patch profiles applied with @apply use=.
- javascript.httpJavaScript pre-request and test scripts, and a test that saves a response body to a file.
- trace.httpOne request within its trace budget and one that fails on purpose by breaching it.
Protocols
- graphql.httpInline and file-based GraphQL requests, with queries and variables in queries/.
- sse_manual.httpAn SSE feed to watch in the Stream tab.
- sse_scripted.httpAn SSE feed checked by captures and @assert.
- websocket_manual.httpA WebSocket echo to drive from the live console.
- websocket_scripted.httpA WebSocket echo driven by @ws steps and checked by @assert and an @rts test block.
- streaming.httpThe @sse and @websocket directives side by side, against public test servers.
- grpc.httpgRPC with server reflection, metadata and a plaintext override, and a call that reads a local .proto file.
Workflows and mocks
- workflows.httpA full workflow with captures, overrides, and expectations.
- compare.http@compare directives and multi-environment sweeps started from the CLI.
- mocks.httpMock routes, variants, matchers, selectors, latency, and fixture bodies.
- polling-retries.httpPolling and retries against mock sequences in the same file. Two requests fail on purpose.
- recording.httpA local walkthrough of resterm record against a mock server.