Requests
Configure HTTP request settings for t-req.
This page covers configuration options for HTTP requests. For usage documentation, see HTTP Mode.
Configure default HTTP request behavior in your treq.json config file.
Configuration
{ "requests": { "timeout": 30000, "verify_ssl": true, "cookies": { "auto_capture": true, "send_from_jar": true }, "history_retention": "forever", "history_content": { "request_headers": true, "request_body": true, "response_headers": true, "response_body": true, "cookies": false, "test_results": true, "hook_results": false }, "redaction": { "enabled": true, "patterns": ["password", "secret", "token", "api_key"], "placeholder": "[REDACTED]" } }}Available Options
| Option | Type | Default | Description |
|---|---|---|---|
timeout | number | 30000 | Request timeout in milliseconds |
verify_ssl | boolean | true | Verify SSL certificates |
cookies.auto_capture | boolean | true | Automatically capture cookies from responses |
cookies.send_from_jar | boolean | true | Send cookies from the cookie jar with requests |
history_retention | string | "forever" | How long to retain request history. Options: "forever", "30days", "7days", "session" |
history_content | object | see below | Configure which data to save in history |
redaction | object | see below | Configure sensitive data redaction |
History Content Options
Control which parts of requests and responses are saved to history.
| Option | Type | Default | Description |
|---|---|---|---|
request_headers | boolean | true | Save request headers |
request_body | boolean | true | Save request body |
response_headers | boolean | true | Save response headers |
response_body | boolean | true | Save response body preview |
cookies | boolean | false | Save captured cookies |
test_results | boolean | true | Save test execution results |
hook_results | boolean | false | Save hook execution results |
Redaction Options
Automatically redact sensitive data before saving to history. This helps keep secrets out of your history files while still making requests accessible to agents.
| Option | Type | Default | Description |
|---|---|---|---|
enabled | boolean | true | Enable sensitive data redaction |
patterns | string[] | see below | Keywords to match for redaction (case-insensitive) |
custom_patterns | string[] | [] | Additional regex patterns for redaction |
placeholder | string | "[REDACTED]" | Text to replace redacted values with |
Default redaction patterns:
password, secret, token, api_key, apikey, api-key, authorization, bearer, access_token, accessToken, refresh_token, refreshToken, private_key, privateKey, credential
Configuration Precedence
Settings are applied in this order (later overrides earlier):
- Hardcoded defaults - Built-in values
- treq.json config - Your requests settings
- CLI arguments - Command-line overrides (e.g.,
--timeout) - Request-specific - Per-request settings in TUI
Examples
Disable SSL verification for development:
{ "requests": { "verify_ssl": false }}Short timeout with session-only history:
{ "requests": { "timeout": 5000, "history_retention": "session" }}Disable automatic cookie handling:
{ "requests": { "cookies": { "auto_capture": false, "send_from_jar": false } }}Redact custom API keys and JWT tokens:
{ "requests": { "redaction": { "enabled": true, "patterns": ["accessCode", "secretKey", "apiToken"], "custom_patterns": [ "sk-[a-zA-Z0-9]{48}", "eyJ[a-zA-Z0-9_-]*\\.[a-zA-Z0-9_-]*\\.[a-zA-Z0-9_-]*" ], "placeholder": "[REDACTED]" } }}Save minimal history (exclude headers and body):
{ "requests": { "history_content": { "request_headers": false, "request_body": false, "response_headers": false, "response_body": false } }}Save full history including cookies and hooks:
{ "requests": { "history_content": { "cookies": true, "hook_results": true } }}