Skip to content

Writing Portable Files

For maximum cross-tool compatibility, stick to these features:

@host = api.example.com
@token = my-auth-token
### Get users
GET https://{{host}}/api/users
Accept: application/json
Authorization: Bearer {{token}}
### Create user
POST https://{{host}}/api/users
Content-Type: application/json
{
"name": "Jane Doe",
"email": "jane@example.com"
}

Specifically:

  • Standard HTTP methods (GET, POST, PUT, DELETE, PATCH, HEAD, OPTIONS)
  • ### separators
  • # or // comments
  • @var = value variable definitions
  • {{variable}} substitution
  • < filepath file includes (except VS 2022)

Use http-client.env.json for environments. It's supported by 4 of 5 primary clients:

{
"development": {
"host": "localhost:3000",
"token": "dev-token"
},
"production": {
"host": "api.example.com",
"token": "prod-token"
}
}

VS Code REST Client is the outlier — it uses settings.json. If you need VS Code compatibility, either:

  1. Use httpyac as your VS Code client (it reads http-client.env.json)
  2. Maintain both formats

Some features are only available in specific clients. When you use them, document which client is required.

If you need...Target
Response handler scriptsJetBrains, httpyac, or kulala
Pre-request scriptsJetBrains, httpyac, or kulala
Compact assertions (??)httpyac
GraphQLJetBrains (GRAPHQL keyword) or httpyac (auto-detect)
WebSocketJetBrains, httpyac, or kulala
gRPCJetBrains, httpyac, or kulala
OAuth2 (full)httpyac
AWS authVS Code REST Client, httpyac, or kulala
Azure secretsVS 2022
Code generationVS Code REST Client
CI/CDijhttp (JetBrains CLI) or httpyac CLI

The Compatibility section has the full per-feature tables behind these recommendations.

httpyac supports both JetBrains and VS Code REST Client syntax while adding its own extensions. If your team uses mixed editors, httpyac-compatible .http files are the closest thing to a universal format.

The .http format lacks a formal standard. This site documents what exists across all implementations and highlights where they diverge. The long-term goal is to help the community converge on a shared specification that preserves the format's simplicity while reducing unnecessary incompatibilities.

If you maintain an .http file client and want to contribute to this effort, see the standardization process — the compatibility data is open for pull requests.