Skip to content

Imports & Cross-File

import ./auth-requests.http
run ./auth-requests.http#loginRequest

import makes requests from another file available. run executes a specific named request or all requests in a file. Variables can be overridden:

run ./file.http#request (@var=value)
# @import ./shared.http
# @ref loginRequest
GET https://api.example.com/protected
Authorization: Bearer {{loginRequest.token}}

# @import loads variables and named requests from another file. # @ref declares a dependency — the referenced request is executed if needed.

Supports JetBrains-compatible import and run syntax.

VS Code REST Client and Visual Studio 2022

Section titled “VS Code REST Client and Visual Studio 2022”

Neither supports cross-file imports or execution.

Feature VS CodeJetBrainshttpyacVS 2022kulala
Body from external file (< filepath)
File include with variable substitution (<@ filepath) JetBrains resolves variables by default; VS Code and httpyac require <@.
File include with encoding (<@encoding filepath)
Save response to file (>>)
Overwrite response file (>>!)
Response comparison reference (<>) Compare current response against a saved file.
Multipart form data with boundary
Import/run from other .http files JetBrains: import/run syntax. httpyac: @import/@ref. kulala: JetBrains-compatible.