Requests - Hook

Hook Docs / Requests

Requests

HTTP methods

The method dropdown supports: GET, POST, PUT, PATCH, DELETE, HEAD, OPTIONS. Select the method before entering the URL.

URL field

The URL field receives keyboard focus automatically when Hook starts, so you can begin typing immediately.

Type the full URL including the scheme (http:// or https://). The URL field supports template expansion: any {{varname}} token is replaced with the value from the active environment before sending.

Example:

{{base_url}}/api/users/{{user_id}}

If no environment is active or the variable is not defined, the token is left as-is.

Query parameters (Params tab)

The Params tab shows a key-value table of query parameters. Each row has a key field, a value field, and an enabled checkbox. Disabled parameters are excluded from the request.

Parameters are appended to the URL as ?key=value&key2=value2. Values support {{varname}} expansion.

Headers tab

The Headers tab shows a key-value table of request headers. Each row has a name, a value, and an enabled checkbox. Disabled headers are not sent.

Header values support {{varname}} expansion.

Body tab

The Body tab has a type selector with six options:

Body content supports {{varname}} expansion.

Auth tab

The Auth tab controls authentication. Six types are available:

Auth field values support {{varname}} expansion.

Settings tab

The Settings tab contains both per-request and program-wide settings. Per-request defaults are persisted across restarts in hook.conf.

Per-request settings

Program-wide settings (also in Settings tab)

User-Agent presets

Hook includes a User-Agent preset system for quickly switching between browser identities.

Preset files

Presets are JSON files stored in the user-agents/ directory:

{
  "name": "Chrome Windows",
  "user_agent": "Mozilla/5.0 (Windows NT 10.0; ...) Chrome/131.0.0.0"
}

Using presets

There are two ways to select a User-Agent:

Selecting a preset sets the User-Agent header on the active request and saves it as the default in hook.conf. The last-used preset is restored on startup.

Sending a request

Click the Send button or press Enter while the URL field has focus to execute the request. The sequence is:

  1. Pre-request script runs (if defined).
  2. Environment variables are expanded in URL, headers, body, auth.
  3. Authentication is applied (headers or params added).
  4. The HTTP request is sent via the native backend or curl subprocess.
  5. Post-request script runs (if defined).
  6. The response is displayed, including a per-phase timing breakdown (see the Times tab below).

Cancelling a request

While a request is in flight, the Send button changes to Cancel. Click it to abort the request – this works with either backend (the native engine’s socket is interrupted; the curl subprocess is killed). The activity log records the cancellation, the status bar shows “Cancelled”, and the button returns to Send. The Timeout (ms) setting also aborts a request automatically once the deadline is reached, on both backends.

Response panel

After a request completes, the response panel shows:

Pretty body view

Hook detects the body format from the Content-Type response header (falling back to sniffing the content) and shows a Pretty checkbox with the detected kind (JSON, XML, HTML, JS, YAML) next to the tab buttons when the Body tab is active.

With Pretty checked (the default), the body is shown reformatted and syntax-highlighted:

Unchecking Pretty shows the raw body exactly as received. The checkbox is disabled when there is nothing to prettify (plain text bodies). Bodies larger than 4 MB are never reformatted. The pretty view is read-only; select text with the mouse and copy it with Ctrl+C.

The response panel includes a search bar below the tab buttons. To search within the currently active tab (Body, Headers, or Log):

  1. Type a search term in the search input field.
  2. Click Search (or press Enter) to find the first match.
  3. Click Next to jump to the next match, Prev to go back.
  4. Click X to clear the search and reset highlighting.

Search is case-insensitive. The matching text is highlighted and the view scrolls to center the match. On the Body tab the search runs in whichever view is visible (pretty or raw). When Next/Prev wraps around past the end or beginning, the statusbar shows a wrap indicator.

Activity log

The Log tab in the response panel shows a timestamped log:

[23:53:33] >> GET https://api.example.com/users
[23:53:33] [auth] applying bearer authentication
[23:53:34] << 200 OK (163 ms, 78.1 KB)
[23:53:34] [script] post-request script executed

Events logged: request send (>>), response received (<<), errors, auth application, script function output (log, get_status, get_header), retry attempts, full curl commands, and network-level errors (DNS resolution failures, TLS handshake errors).

The log is in-memory only, cleared on app restart.

Hook has a built-in cookie jar that automatically manages cookies across requests, similar to how a browser works.

Enable it in the request Settings tab by checking “Enable cookie jar”. You can also set it in hook.conf:

"cookie_jar_enabled": 1,
"cookie_jar_path": "cookies.txt"

How it works

When the cookie jar is enabled:

Persistence

The cookie jar is saved to disk in Netscape cookie format (the same format used by curl and browsers). The file path is configured by cookie_jar_path in hook.conf (default: cookies.txt).

The jar is loaded at startup and saved on exit. Session cookies (no expiry) are included in the saved file.

Typical use cases

Server-Sent Events (SSE)

Hook includes an SSE viewer for streaming event endpoints. SSE is a one-way protocol where the server pushes events to the client over a long-lived HTTP connection.

Using the SSE viewer

  1. Click SSE in the toolbar to open the SSE Viewer popup.
  2. Enter the SSE endpoint URL (e.g. https://sse.dev/test).
  3. Click Connect. The viewer starts receiving events in the background.
  4. Received events appear in the event list with their type and data.
  5. Click Stop to disconnect.

The SSE viewer runs in a background thread. You can continue using Hook for other requests while the SSE connection is active.

Both HTTP and HTTPS endpoints are supported. The URL scheme determines whether TLS is used.

WebSocket

Hook includes a WebSocket client for interactive bidirectional communication with WebSocket endpoints.

Using the WebSocket popup

  1. Click WS in the toolbar to open the WebSocket popup.
  2. Enter the WebSocket URL (e.g. wss://echo.websocket.org/). Both ws:// and wss:// (TLS) schemes are supported.
  3. Click Connect. The status label updates to show the connected URL.
  4. Type a message in the Send field at the bottom and click Send. The message appears in the log with a >> prefix.
  5. Incoming messages appear with a << prefix.
  6. Click Clear to empty the message log.
  7. Click Disconnect to close the connection.

The WS toolbar button turns green while connected.

Message log format

Messages are shown with direction indicators:

>> Hello server
<< {"status":"ok","echo":"Hello server"}
>> ping
<< pong

The receive loop runs in a background thread, so incoming messages appear automatically without blocking the GUI.

curl export

Every request can be exported as a curl command. The curl command reflects all settings: