Overview
Bru is Bruno’s plain text markup language for defining API requests. It’s human-readable, Git-friendly, and structured around blocks that define different aspects of an HTTP request.Every
.bru file represents a single API request and uses a block-based syntax for organizing request metadata, headers, body, scripts, and tests.File Structure
A.bru file is composed of blocks. There are three types of blocks:
Dictionary Blocks
Key-value pairs for headers, metadata, auth, etc.
Text Blocks
Multi-line text content for body, scripts, tests
List Blocks
Arrays of items like tags or secret variables
Basic Request Example
Here’s a complete example from the Bruno test suite:echo json.bru
Core Blocks
Meta Block
Every request starts with a meta block defining its properties:string
required
Display name of the request
string
required
Request type:
http, graphql-request, grpc-request, ws-request, or jsnumber
Sequence number for ordering requests
HTTP Method Blocks
Define the HTTP method and URL:get, post, put, delete, patch, options, head, connect, trace
Headers Block
Define request headers using key-value pairs:~ prefix to disable a header without deleting it.
Query Parameters
Path Parameters
Authentication Blocks
Bruno supports multiple authentication methods:Bearer Token
Basic Auth
API Key
OAuth2
AWS Signature v4
Digest Auth
Body Blocks
JSON Body
XML Body
Text Body
Form URL Encoded
Multipart Form
GraphQL
Variables
Pre-request Variables
Post-response Variables
Scripts
Pre-request Script
Post-response Script
Tests and Assertions
Assertions Block
Tests Block
Settings Block
Configure request-specific settings:boolean
Whether to URL-encode the request URL (default: true)
boolean
Whether to follow HTTP redirects (default: true)
number
Maximum number of redirects to follow (0-50)
number
Request timeout in milliseconds
Documentation Block
Add documentation to your request:Advanced Features
Multiline Text with Delimiters
Use triple quotes for multiline values:Quoted Keys
Use quotes for keys with special characters:Disabling Items
Prefix any key with~ to disable it:
Complete Example
Here’s a full-featured request from the Bruno source:Login Request.bru
Next Steps
Collections
Learn how to organize requests into collections
Environments
Use variables across different environments
Scripting
Write JavaScript to add dynamic behavior
Testing
Write tests and assertions for your APIs