File include syntax
Section titled “File include syntax”The < operator includes the contents of an external file as the request body:
POST https://api.example.com/dataContent-Type: application/json
< ./payload.jsonFile 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.
Variable substitution in included files
Section titled “Variable substitution in included files”VS Code REST Client and httpyac use <@ to indicate that variables within the included file should be resolved:
POST https://api.example.com/dataContent-Type: application/json
<@ ./template.jsonJetBrains 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
| Feature | VS Code | JetBrains | httpyac | VS 2022 | kulala |
|---|---|---|---|---|---|
< filepath (raw include) | Yes | Yes | Yes | No | Yes |
<@ filepath (with variable substitution) | Yes | N/A (default) | Yes | No | Yes |
<@encoding filepath | Yes | No | No | No | No |