When an HTTP button is pressed, everyDocumentation 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}} placeholder is replaced with the corresponding argument value. The encoding applied to that value depends on where in the request the placeholder appears.
This page documents the encoding rules and shows what each one prevents.
Encoding rules by location
| Location | Encoding | Go function |
|---|---|---|
URL path segment (before ?) | Percent-encode all characters not safe in a path | url.PathEscape |
URL query parameter value (after ?) | Percent-encode all characters not safe in a query | url.QueryEscape |
JSON body (Content-Type: application/json) | Escape ", \, and control characters | json.Marshal string encoding |
Form body (application/x-www-form-urlencoded) | Same as query parameter | url.QueryEscape |
| Header value | None — passed raw | — |
Attack scenario 1: URL query injection
Template:real&admin=true
Without encoding:
&admin=true becomes a second query parameter that the server sees.
With QueryEscape:
& and = are percent-encoded. The server receives q = real&admin=true as a single value.
Attack scenario 2: URL path traversal
Template:../../etc/passwd
Without encoding:
PathEscape:
Attack scenario 3: JSON field injection
Template:","role":"admin
Without encoding:
role value.
With JSON string escaping:
Header values
Header values are substituted without encoding. This is correct for tokens and API keys where encoding would break the value (e.g. a base64-encoded credential that contains+ and =).
Raw body types
For bodies with aContent-Type other than application/json or application/x-www-form-urlencoded, substitution is raw — no encoding is applied. Use this only when you fully control the body format.
Related
- URL and body templates — how templates work at a conceptual level
- HTTP API buttons — full flag reference
- Security overview — threat model and assumptions