Variables
Section titled “Variables”| Feature | VS Code | JetBrains | httpyac | VS 2022 | kulala |
|---|---|---|---|---|---|
| Inline variable definition (@var = value) | |||||
| Variable substitution ({{variableName}}) | |||||
| Percent-encoding substitution ({{%var}}) URL-encodes the variable value. Unique to VS Code REST Client. | |||||
| Lazy variables (@var := value) Evaluated at execution time rather than parse time. | |||||
| Named request response chaining Syntax differs: VS Code uses dot-path ({{name.response.body.$.path}}), JetBrains uses script-based global variables, httpyac uses @ref. | |||||
| Environments in settings.json | |||||
| http-client.env.json | |||||
| http-client.private.env.json | |||||
| http-client.env.json.user Microsoft-specific override file. | |||||
| .env dotenv files VS Code REST Client and VS 2022 support via {{$dotenv NAME}} accessor. httpyac and kulala parse .env files natively. | |||||
| JS/JSON config file httpyac.config.js or .httpyac.js | |||||
| $shared environment | |||||
| Secrets providers (Azure Key Vault, etc.) ASP.NET Core User Secrets, Azure Key Vault, DPAPI. |
Dynamic variables
Section titled “Dynamic variables”| Feature | VS Code | JetBrains | httpyac | VS 2022 | kulala |
|---|---|---|---|---|---|
| UUID v4 VS Code: {{$guid}}, JetBrains: {{$uuid}}, httpyac: both syntaxes. VS 2022 does not document UUID generation. | |||||
| Unix timestamp {{$timestamp}} — universal syntax. | |||||
| Random integer VS Code: {{$randomInt min max}}, JetBrains: {{$randomInt}} (0-1000). | |||||
| Datetime formatting VS Code: {{$datetime format}}, JetBrains: {{$isoTimestamp}}. | |||||
| Random data (Faker-based) Java Faker: $random.name, $random.address, $random.lorem, etc. | |||||
| OS environment variables VS Code: {{$processEnv NAME}}, JetBrains: {{$env.NAME}}. | |||||
| User prompt for input VS Code: @prompt, httpyac: {{$input prompt}}, kulala: @prompt. | |||||
| Azure AD / OIDC tokens {{$aadToken}}, {{$aadV2Token}}, {{$oidcAccessToken}}. |
Key portability notes
Section titled “Key portability notes”Environment format
Section titled “Environment format”The biggest portability challenge is environment configuration:
- VS Code REST Client uses
settings.json— not portable to any other client http-client.env.jsonis the closest to a standard, supported by JetBrains, httpyac, VS 2022, and kulala.nvim.envfiles are supported by httpyac and kulala.nvim- httpyac is the only bridge that supports all formats
For maximum portability, use http-client.env.json.
Variable syntax
Section titled “Variable syntax”@var = value and {{var}} are universal. Everything else has caveats:
- Percent-encoding
{{%var}}is VS Code only - Lazy variables
:=are httpyac only - Faker random data
$random.nameis JetBrains only - Azure AD tokens
$aadTokenare VS Code only
Response chaining
Section titled “Response chaining”Three fundamentally different approaches:
- VS Code REST Client: declarative dot-path syntax (
{{name.response.body.$.jsonPath}}) - JetBrains: imperative scripts that store to global variables (
client.global.set()) - httpyac:
@refdependencies with automatic response-as-variable
VS 2022 adopted the VS Code REST Client syntax. kulala.nvim supports the JetBrains approach.