The .http format
Fetchpier reads and writes requests as .http files: standard HTTP syntax plus a small set of
comment-prefixed extensions. This page is the syntax reference; see
Requests (.http) for the conceptual overview.
Anatomy of a request
Section titled “Anatomy of a request”# @id 9e3a4f72-1234-4abc-9def-0123456789ab# @rawSubtype: json
# @pre-request-script# fp.environment.set('token', 'abc')# @end-script
# @settings# httpVersion: auto# verifySsl: true# followRedirects: true# maxRedirects: 5# @end-settings
POST {{baseUrl}}/api/usersContent-Type: application/json
{ "name": "Juan" }Directives
Section titled “Directives”| Directive | Meaning |
|---|---|
{{variable}} | Placeholder resolved against the active environment (merged with in-flight script mutations) in URL, headers, body, and form fields. |
### | Request separator. Fetchpier keeps one request per file: when a file holds several, it opens and runs only the first (see Compatibility). |
# @id <uuid> | Stable UUID identifying the request across renames and moves. |
# @rawSubtype: <type> | Body sub-type — json, xml, javascript, text, or html — for highlighting and Content-Type defaults. |
# @pre-request-script … # @end-script | Pre-request script, carried as comment-prefixed lines. |
# @post-response-script … # @end-script | Post-response script, carried as comment-prefixed lines. |
# @settings … # @end-settings | Per-request HTTP overrides (see Environments). |
# @disable-cookie-jar | Bypass the cookie jar for this send. |
# @auth … # @end-auth | The request’s authentication scheme — type and field mapping — so it survives save / reopen. |
The # @auth block
Section titled “The # @auth block”The # @auth block persists the request’s authentication scheme so the type and field mapping survive
a save / reopen round-trip. The active scheme is also materialized into the executable request as a
standard header (or a leading query parameter), so the file still sends auth when opened in another
.http tool. A None scheme writes no block and no materialized entry.
A malformed block — including one whose closing line is missing — is reported and ignored, and the request it belongs to is still loaded and still runnable, without auth.
See Authentication for the schemes themselves.
Because the format is plain text, the same file is readable from any editor and reviewable in a diff.
Compatibility with other .http tools
Section titled “Compatibility with other .http tools”Fetchpier reads and writes its own .http dialect: standard HTTP syntax plus the comment-prefixed
directives above. Keep these limits in mind when you bring files from, or take them to, another tool.
One request per file. A file can contain several requests separated by ###, but Fetchpier opens
and runs only the first one, in the desktop app and in fp run (the CLI prints a notice naming the
file). Split a multi-request file into one file per request before working with it.
Coming from VS Code REST Client or JetBrains HTTP Client. Fetchpier does not support those tools’ own extensions:
- file-level variables (
@name = value); - a request line without a method;
- query parameters continued on the following lines;
- a body read from a file with
< path; > {% … %}response handlers;- their own dynamic variables.
Define variables in a Fetchpier environment instead, and move response handling to a post-response script.
Going to another tool. Simple requests also run in VS Code REST Client and JetBrains HTTP Client once you define their variables there; the active auth scheme is written into the request as a standard header, so it travels too. Environments, scripts and tests are Fetchpier-specific and would need to be recreated.