docs Request files
HTTP transport and settings
Base URLs, timeouts, proxies, TLS and other transport settings.
- CLI-wide transport defaults are available through flags (
--timeout,--follow,--insecure,--proxy). - Per-request overrides use
@setting,@settings, or@timeout.
Relative request URLs
Set base-url to resolve shorter HTTP request targets without repeating a host:
# File default when declared before the first request
# @setting base-url https://api.example.com/v1/
### List users
GET users?page=2
### Root-relative health check
GET /health
### One-request override
# @setting base-url https://admin.example.com/api/
GET statusThe same setting can be selected globally through an environment:
{
"dev": {
"settings.base-url": "https://api.dev.example.com/v1/"
},
"prod": {
"settings.base-url": "https://api.example.com/v1/"
}
}Environment, file, and request values use the normal global < file < request precedence. Setting keys are case-insensitive. A base or request target may contain templates, such as # @setting base-url {{services.api.base}}; the base is expanded only when the final request target is relative. An absolute request target ignores base-url, including an invalid or unresolved non-empty value. A skipped request and a gRPC request do not use it either.
Relative targets follow standard URI-reference resolution, including path-relative, root-relative, query-only, parent-segment, and network-path references:
Base https://api.example.com/v1/ |
Effective URL |
|---|---|
users |
https://api.example.com/v1/users |
/users |
https://api.example.com/users |
../health |
https://api.example.com/health |
?page=2 |
https://api.example.com/v1/?page=2 |
//uploads.example.com/x |
https://uploads.example.com/x |
https://other.example.com/x |
unchanged |
Trailing slash semantics are significant: https://api.example.com/v1/ plus users keeps /v1/, while https://api.example.com/v1 plus users produces https://api.example.com/users. Resterm does not insert a slash.
The configured base must be an absolute http or https URL with a host. It may include a port and path, but not userinfo, a query, or a fragment. An explicitly empty value is an error. A relative request without a usable base fails before connecting. Network-path targets (//host/path) deliberately may change the destination host; request headers and configured authentication apply to that effective host.
REST, GraphQL, SSE, and WebSocket requests share the setting. For WebSockets, an effective http URL becomes ws and https becomes wss; WebSocket fragments are rejected. base-url does not change gRPC targets. A request method remains required, so GET /users is valid while a bare /users line is not a request.
URLs without a scheme
You can omit http:// when a request URL starts with a host and port. Resterm uses plain HTTP:
| Request line | Effective URL |
|---|---|
GET localhost:8080/users |
http://localhost:8080/users |
GET 127.0.0.1:8080/users |
http://127.0.0.1:8080/users |
GET [::1]:8080/users |
http://[::1]:8080/users |
GET [::1]/users |
http://[::1]/users |
The port distinguishes these URLs from relative paths. Bracketed IPv6 addresses are also clear without a port, so [::1]/users works. These URLs are absolute and ignore base-url. Resterm always adds http://; write https:// when you want TLS.
Only the start of the request URL is checked. A URL in a query value does not affect the destination: GET localhost:8080/p?next=http://example.com still connects to localhost:8080. A known scheme without //, such as https:443/path, is rejected instead of being treated as a host named https.
For a request with # @websocket, Resterm changes the added scheme to ws://. For example, GET localhost:8080/socket connects to ws://localhost:8080/socket. The @websocket directive starts the session; using WS as the method does not.
A hostname without a port remains a relative URL. With base-url set to https://api.example.com/v1/, GET example.com/users resolves to https://api.example.com/v1/example.com/users. Write http://example.com/users when example.com is the destination host.
Templates are expanded before these rules are applied. When a variable represents a server, include either a port or a scheme:
Value of {{host}} |
Result of GET {{host}}/users |
|---|---|
localhost:8080 |
http://localhost:8080/users |
127.0.0.1:9000 |
http://127.0.0.1:9000/users |
http://example.com |
http://example.com/users |
example.com |
A relative URL; requires base-url |
A template can also provide part of the URL. Both GET http://{{host}}/users and GET localhost:{{port}}/users work.
Other HTTP settings
-
HTTP version:
@setting http-version 1.1(accepts1.1,2,HTTP/1.1,HTTP/2). A trailingHTTP/1.1on the request line also sets the version; explicit settings win.2is strict and fails if the response is not HTTP/2. WebSocket requests are incompatible with2. -
HTTP/1.0 is not supported. Resterm rejects
http-version 1.0, trailingHTTP/1.0, and other unsupported version tokens such asHTTP/3. -
Only a trailing
HTTP/<major>orHTTP/<major>.<minor>is read as a version. Any other trailing text stays part of the URL, soGET https://example.com/a http/foorequests/a%20http/foo. -
Resterm removes credentials before following a redirect to another origin. An origin is the scheme, host, and port. Changing any of these creates a different origin. Resterm removes known credential headers and any custom header named by
@auth, even when that header was already on the request. -
Use
@setting forward-credentials-on-redirectto send credentials to specific origins:http # @setting forward-credentials-on-redirect https://cdn.example.com https://media.example.comMatches are exact. A listed origin does not include its subdomains or other ports.
wss://matches the same origin ashttps://, andws://matches the same origin ashttp://. The default isfalse. Usetrueto send credentials to any origin. A list is safer because it only allows the named origins. An empty value is an error.These rules cannot be changed:
- If a redirect chain moves from HTTPS to HTTP, Resterm stops sending credentials for the rest of the chain. This also applies if a later redirect returns to HTTPS or to the original origin. The HTTP server controls every redirect that follows.
- A
Cookieheader is never copied to another origin. The cookie jar may still add cookies that belong to the new origin. - OAuth token requests stay on the token endpoint's origin. A 307 or 308 redirect can resend the client secret in the body, so removing headers would not protect it.
- When a redirect goes to another origin, Resterm sends only the origin of the previous URL in the
Refererheader. It removes the path and query, so a key added with@auth ... querydoes not reach the new origin. Resterm checks each redirect separately. If the next URL has the same origin, theRefererkeeps the full previous URL, even if an earlier redirect crossed an origin boundary. Resterm leaves an explicitly setRefererunchanged.
-
Resterm follows up to 10 redirects by default. Set another limit with
@setting max-redirects 20or--max-redirects. Use0ornoneto stop at the first redirect.@setting followredirects falsealso stops at the first redirect. There is no unlimited setting because the request must stop if the server sends a redirect loop. -
Response bodies are limited to 32 MiB. Change the limit with
@setting max-response-size 100mb,@setting max-response-size none, or--max-response-size. Resterm checks the size after decompressing the body. A larger body stops the request with an error. -
SSE lines are limited to 4 MiB and SSE events to 8 MiB. Change these limits with
@sse max-line-bytesand@sse max-event-bytes. A larger line or event stops the stream with an error naming the limit to raise. Reaching@sse max-bytesends the stream without an error. WebSocket messages are limited to 32 KiB unless@websocket max-message-bytessets another limit. -
To change these limits for more than one request, use the
sse-max-line-bytes,sse-max-event-bytes, andws-max-message-bytessettings. They take a size such as8mband set the default every request starts from, so an environment or a file can raise a limit once instead of repeating it. A@sseor@websocketdirective on the request still wins. These settings do not acceptnone, because a stream with no line limit has nothing to stop it.http # @setting sse-max-line-bytes 16mb # @setting ws-max-message-bytes 1mb -
Most events arrive as a single
data:line, so the line limit is the one they reach first. Raisemax-line-bytesalong withmax-event-byteswhen a single line carries the whole payload. Base64 adds about a third to a payload, so a 3 MiB file needs roughly 4 MiB of headroom. -
Resterm limits how much stream data it keeps in memory. An SSE session keeps up to 1024 events and 16 MiB, or twice
max-event-byteswhen that is larger. The size of an SSE event includes its data, comment, id, name, and other saved fields. A WebSocket session and its saved transcript each have an 8 MiB limit. The Stream pane keeps up to 5000 events or 16 MiB. If Resterm removes older events, the summary counts them indropped. The Stream tab showsTranscript incompletewhen its view is missing events. -
Reaching
max-events,max-bytes,idle, ordurationis a normal way for a stream to end. Other problems fail the request. These include an expired run deadline, a read error, an SSE line or event that exceeds its limit, and a WebSocket session that ends withclosedBy: error. Resterm still saves and reports the transcript it collected. With detailed exit codes, a cancelled run returns130and a stream error returns the code for the failure named insummary.errorClass:20fortimeout,21fornetwork,22fortls,25forfilesystemsuch as an@ws send-filepayload Resterm could not read, and26forprotocol. A stream that failed for a reason Resterm cannot name reportsprotocol. -
Requests use an in-memory cookie jar per environment. Cookies are isolated between environments, and
@setting no-cookies truedisables cookies for a request without clearing the stored jar. UseCtrl+Shift+G(org Shift+G) to clear cookies for the current environment. -
TLS per request:
# @settings http-root-cas=a.pem http-client-cert=cert.pem http-client-key=key.pem http-insecure=truefor a single line, or@setting key valueper line (http-root-casaccepts space/comma/semicolon separated lists; paths are relative). GraphQL/REST/WebSocket/SSE all share these HTTP settings. -
Use
@no-logto omit sensitive bodies from history snapshots. -
History is stored in
${RESTERM_CONFIG_DIR}/history.db(defaults to the platform config directory) and has no fixed entry cap. SetRESTERM_CONFIG_DIRto relocate it. -
On first launch after upgrading, Resterm imports
${RESTERM_CONFIG_DIR}/history.jsonintohistory.dbautomatically when present. -
If the SQLite history file is detected as corrupted, Resterm quarantines it to
history.db.corrupt-<timestamp>and initializes a freshhistory.db. -
Custom root CAs replace system roots by default (strict). Set
http-root-mode appendorgrpc-root-mode appendif you want to keep system roots in addition to your own. -
File-level defaults: place
# @setting key valueor# @settings key1=val1 ...before the first request to apply to all requests in that file. Request-level overrides still win. -
HTTP, transport, and TLS settings include
base-url,http-*,grpc-*,timeout,proxy,followredirects,max-redirects,forward-credentials-on-redirect,max-response-size,sse-max-line-bytes,sse-max-event-bytes,ws-max-message-bytes,insecure, andno-cookies. Resterm ignores unknown keys. -
Boolean settings (
followredirects,insecure,no-cookies,http-insecure,grpc-insecure) accepttrue/false,yes/no,on/off, and1/0. A key written on its own is a flag meaningtrue, so# @setting insecure,# @settings insecure, and# @setting insecure trueare the same thing.@settingalso accepts thekey=valuespelling, so# @setting insecure=falsemeans what# @settings insecure=falsedoes. -
Settings validate their values. A value outside a setting's vocabulary fails the request instead of falling back to a default, so a typo cannot silently leave TLS verification or redirects at the wrong setting. This covers booleans,
timeout(a Go duration such as30s),proxy(a URL with a scheme and host, such ashttp://host:8080),http-version, andhttp-root-mode/grpc-root-mode. A non-emptybase-urlis resolved and validated only when a relative HTTP-family target needs it. Writing a key with an empty value (# @settings insecure=, or"settings.insecure": ""in an environment file) is reported as a missing value rather than treated as a flag. -
Environment defaults:
resterm.env.jsoncan carry global settings under thesettings.prefix (e.g.,"settings.base-url": "https://api.example.com/v1/","settings.http-root-cas": "ca-dev.pem","settings.grpc-insecure": "false"). Precedence is global (env) < file < request. -
OAuth token exchanges reuse the same HTTP TLS settings (root CAs, client cert/key,
http-insecure) as the main request.
Body helpers:
< pathloads file contents as the body.- Inline XML/SOAP tags are treated as body text.
# @body inlineor# @body rawforces prefixed body lines to remain inline text.@ pathinside the body injects file contents inline.- GraphQL payloads are normalized automatically.