.http files
.http files contain one or more HTTP requests. They follow the community-standard .http format compatible with VS Code REST Client and JetBrains HTTP Client.
Basic request
Section titled “Basic request”### Get single userGET https://api.example.com/users/42The ### line names the request (optional). The next line is the method + URL. Supported methods: GET, POST, PUT, PATCH, DELETE, OPTIONS, HEAD.
Multiple requests in one file
Section titled “Multiple requests in one file”Use ### dividers to separate multiple requests:
### List usersGET https://api.example.com/users
### Get single userGET https://api.example.com/users/42
### Create userPOST https://api.example.com/usersContent-Type: application/json
{ "name": "Jane Doe", "email": "jane@example.com"}
### Update userPUT https://api.example.com/users/42Content-Type: application/json
{ "name": "Jane Updated" }
### Delete userDELETE https://api.example.com/users/42Click any ▶ gutter button to run that specific request. Press ⌘⇧Enter to run all requests in the file sequentially.
File-level variables
Section titled “File-level variables”Define variables before the first ###. Reference them anywhere with {{name}}.
@baseUrl = https://api.example.com@token = secret-key
GET {{baseUrl}}/usersAuthorization: Bearer {{token}}Variables resolve in priority order: file-level → active .env file → extracted flow variables.
Headers
Section titled “Headers”Write headers between the method line and the body (one header per line):
### Authenticated JSON requestPOST https://api.example.com/usersContent-Type: application/jsonAuthorization: Bearer {{API_TOKEN}}Accept: application/jsonX-Request-Id: {{REQUEST_ID}}
{ "name": "Alice" }Request body
Section titled “Request body”Leave one blank line after the last header, then write the body:
### Create postPOST https://api.example.com/postsContent-Type: application/json
{ "title": "Hello world", "body": "My content here", "userId": {{userId}}}Naming requests
Section titled “Naming requests”Named requests can be referenced in flow files:
### Create Order# @name createOrderPOST {{baseUrl}}/ordersContent-Type: application/json
{ "item": "widget", "qty": 3 }File upload — multipart/form-data
Section titled “File upload — multipart/form-data”Use # @file to attach a file and # @field for text fields. Sendpad sets the Content-Type: multipart/form-data boundary automatically.
### Upload avatarPOST {{baseUrl}}/users/42/avatar
# @file photo = ../testdata/avatar.jpg# @field description = "Profile photo for {{username}}"# @field tag = profile# @assert status == 200Multiple files:
### Batch uploadPOST {{baseUrl}}/documents
# @file primary = ../testdata/report.pdf# @file secondary = ../testdata/appendix.pdf# @field category = "Q4 Reports"File paths are relative to the .http file. Store test files in a testdata/ folder.
Raw binary upload
Section titled “Raw binary upload”For non-multipart binary uploads:
### Upload raw imagePUT {{baseUrl}}/avatars/meContent-Type: image/jpeg
# @body = ../testdata/avatar.jpgAssertions
Section titled “Assertions”Validate responses with # @assert directives. They run after the request completes — if any fails, the step is marked as failed and @persist directives are skipped.
### Validate responseGET {{baseUrl}}/users/42
# @assert status == 200 # exact status code# @assert status != 404 # status is not this code# @assert body contains "jane" # response body has this substring# @assert body equals active # response body is exactly "active" (trimmed)# @assert body equals {{expected}} # compare against a variable# @assert header[content-type] contains application/jsonPer-Request Config Overrides
Section titled “Per-Request Config Overrides”Override global HTTP settings for an individual request using comment directives. Useful when one endpoint needs a longer timeout, a different proxy, or relaxed SSL checking without changing the global Settings.
### Slow endpoint — needs more time# @timeout 30sPOST {{baseUrl}}/reports/generateContent-Type: application/json
{ "type": "annual" }
### Internal endpoint with self-signed cert# @no-verifyGET https://internal.corp/health
### Capture redirect without following it# @follow-redirects offGET {{baseUrl}}/auth/sso
### Route through a debug proxy# @proxy http://localhost:8888POST {{baseUrl}}/payments| Directive | Effect |
|---|---|
# @timeout <duration> | Request timeout — e.g. 500ms, 5s, 1.5s, 2m, 1h |
# @no-verify | Disable SSL certificate verification |
# @verify-ssl on|off | Explicitly enable or disable SSL verification |
# @follow-redirects on|off | Enable or disable HTTP redirect following |
# @proxy <url> | Route this request through the given HTTP/S proxy |
Per-request settings override the Settings panel for that request only. Other requests in the same file are unaffected.
Cookie control
Section titled “Cookie control”The cookie jar is enabled by default. Disable it for a specific file:
# @cookies off
### This request sends no cookies and ignores Set-CookieGET {{baseUrl}}/endpointRunning requests
Section titled “Running requests”- ▶ gutter button — runs the request on that line
⌘Enter— runs the request under the cursor⌘⇧Enter— runs all requests in the file sequentially
Server-Sent Events (SSE)
Section titled “Server-Sent Events (SSE)”If a response arrives with Content-Type: text/event-stream, Sendpad auto-detects SSE and switches the Results Panel to a live event timeline — no extra setup required. Events stream in as the server emits them.
You can assert on SSE events inside .http and .flow files using the @expect event and @extract event directives. See the SSE streaming reference for the full set of SSE directives (@sse-timeout, @sse-reconnect, @expect event, etc.).