environment-variables.http
### Values come from the active git-ignored .env file
GET {{baseUrl}}/account
Accept: application/json
Authorization: Bearer {{apiToken}}
### The same environment values can be reused in another request
GET {{baseUrl}}/projects
Accept: application/json
Authorization: Bearer {{apiToken}}
Variables to replace
- baseUrl
- Define this in the active .env file, for example baseUrl=https://api.example.com.
- apiToken
- Define the real token in the same git-ignored .env file.
Expected response
With a registered and active environment, both variables resolve before send and the API returns the normal authenticated response. An unresolved value indicates that the environment is missing or inactive.
Related examples and guides
Learn the full syntax in the .http file format guide, manage secrets with variables and environments, or see how to run .http files on Windows.
Launch Summer Sale
Run this request without leaving Windows.
Karve opens .http files as a native workspace: edit the plain text, press Run, inspect the response, and keep the file in Git.
15-day free trial · No account · No subscription · No metered requests
25% off until Sep 1