Skip to content

File Includes

The < operator includes the contents of an external file as the request body:

POST https://api.example.com/data
Content-Type: application/json
< ./payload.json
VS CodeJetBrainshttpyackulala

File paths can be absolute or relative to the .http file's location (or workspace root in VS Code). Visual Studio 2022 does not support file includes.

VS Code REST Client and httpyac use <@ to indicate that variables within the included file should be resolved:

POST https://api.example.com/data
Content-Type: application/json
<@ ./template.json

JetBrains resolves variables in included files by default. httpyac provides a # @injectVariables metadata tag to control this behavior for JetBrains compatibility.

An encoding can be specified in VS Code REST Client: <@latin1 ./file.xml

FeatureVS CodeJetBrainshttpyacVS 2022kulala
< filepath (raw include)YesYesYesNoYes
<@ filepath (with variable substitution)YesN/A (default)YesNoYes
<@encoding filepathYesNoNoNoNo