Sessions & Storage
Persist cookies across requests with named sessions, manage cookie jars, download files, and save responses to disk.
Named Sessions
Persistent Sessions
Use -N / --session to create a named session that persists cookies and custom headers across multiple requests. Sessions are stored on disk and survive between tgrs invocations.
# First request — login and save session cookies
tgrs POST https://api.example.com/login \
-N dev -d "username=admin&password=secret"
# Subsequent request — session cookies sent automatically
tgrs GET https://api.example.com/profile -N dev
# Another session for staging
tgrs GET https://staging-api.example.com/users -N staging
Save Response
Save Response Body to File
Use -o / --output to write the response body to a file.
# Save response to file
tgrs GET https://api.example.com/users -o response.json
tgrs GET https://api.example.com/users --output response.json
Download Mode
Download with Progress Bar
Use -D / --download to download files with a progress bar. Optionally specify a filename.
# Download a file (auto-detect filename)
tgrs GET https://example.com/files/report.pdf -D
# Download with specific name
tgrs GET https://example.com/files/report.pdf -D my-report.pdf
Filename is auto-detected from Content-Disposition header, URL, or Content-Type. If no filename can be determined, tgrs uses download.{ext} (e.g., download.png, download.json). If the file already exists, tgrs adds a number to avoid overwriting: download.png → download(1).png → download(2).png
Quick Reference
Session & Storage Flags
| Flag | Alias | Description |
|---|---|---|
| -N | --session | Named session (persists cookies/headers) |
| -b | --cookie | Send cookies (inline or @file) |
| -c | --cookie-jar | Save cookies to file |
| -o | --output | Save response body to file |
| -D | --download | Download with progress bar |