HTTP buttons useDocumentation Index
Fetch the complete documentation index at: https://docs.buttons.sh/llms.txt
Use this file to discover all available pages before exploring further.
{{name}} placeholders in the URL, headers, and request body. When you press the button, each placeholder is replaced with the corresponding argument value. The substitution is context-aware: the encoding applied depends on where in the request the placeholder appears.
How substitution works
At press time, Buttons walks the URL and body and replaces every{{name}} with the value of the name argument. The encoding is chosen based on position:
| Location | Encoding |
|---|---|
URL path segment (before ?) | url.PathEscape |
URL query parameter (after ?) | url.QueryEscape |
JSON body (Content-Type: application/json) | JSON string escape (\", \\, control chars) |
Form body (Content-Type: application/x-www-form-urlencoded) | url.QueryEscape |
| Other body types | Raw (no encoding) |
Examples
URL path injection
A user passes../../etc/passwd as the file_id argument:
PathEscape encodes the slashes, so the traversal attempt becomes a literal (non-functional) path segment.
URL query injection
A user passesq=real&admin=true as the query argument:
QueryEscape encodes & and =, so the injected parameter never becomes a second query key.
JSON field injection
A user passes","role":"admin as the username argument:
Headers
Header values also support{{arg}} substitution but are not encoded — they are passed as-is. This is appropriate for values like bearer tokens and API keys where encoding would break the value.
If you need to pass a literal
{{ or }} in a URL or body, escape it as \{{ and \}}.Raw body types
For bodies with aContent-Type other than application/json or application/x-www-form-urlencoded, Buttons inserts values without encoding. Use this only when you control the full body format and know the values are safe.
Related
- HTTP API buttons — full flag reference for URL, method, headers, body
- Template encoding — detailed security analysis of each encoding context
- Security overview — threat model and assumptions