.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.jpgCookie 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