Skip to main content
Bruno supports multiple API protocols and request types, making it a versatile tool for modern API development and testing.

HTTP/REST Requests

HTTP requests are the most common type in Bruno, managed by the HttpRequestPane component.

Supported HTTP Methods

Retrieve resources from the server.
meta {
  name: Get Users
  type: http
}

get {
  url: {{api_url}}/users
  body: none
  auth: none
}

assert {
  res.status: eq 200
}

Request Body Types

The RequestBody component supports multiple content types:

JSON

Most common format for RESTful APIs. Syntax highlighting with CodeMirror using application/ld+json mode.

XML

For SOAP and legacy APIs. Uses application/xml mode.

Form URL Encoded

Managed by FormUrlEncodedParams component. Standard HTML form submissions.

Multipart Form

Handled by MultipartFormParams. Supports file uploads and mixed content types.

Text

Plain text with application/text mode.

SPARQL

Specialized query language support with application/sparql-query mode.

Form URL Encoded Example

From the test suite:
Example from bruno-tests/collection/echo/echo form-url-encoded.bru
meta {
  name: echo form-url-encoded
  type: http
  seq: 9
}

post {
  url: {{echo-host}}
  body: formUrlEncoded
  auth: none
}

body:form-urlencoded {
  form-data-key: {{form-data-key}}
  form-data-stringified-object: {{form-data-stringified-object}}
  key_1: value_1
  key_2: value_2
  key_1: value_3
  key_2: value_4
}

script:pre-request {
  let obj = JSON.stringify({foo:123});
  bru.setVar('form-data-key', 'form-data-value');
  bru.setVar('form-data-stringified-object', obj);
}
Form URL encoded bodies support duplicate keys for array-like data, as shown with key_1 and key_2 above.

GraphQL Requests

Bruno has first-class support for GraphQL, managed by the GraphQLRequestPane component.

Creating GraphQL Requests

1

Create GraphQL Request

When creating a new request, select “GraphQL” as the type.
2

Enter GraphQL Endpoint

Provide the GraphQL endpoint URL (e.g., https://api.example.com/graphql).
3

Write Query

Use the QueryEditor component to write your GraphQL query or mutation.
4

Add Variables

Configure variables using the GraphQLVariables component.

GraphQL Query Example

From the test suite:
Example from bruno-tests/collection/graphql/spacex.bru
meta {
  name: spacex
  type: graphql
  seq: 1
}

post {
  url: https://spacex-production.up.railway.app/
  body: graphql
  auth: none
}

body:graphql {
  {
    company {
      ceo
    }
  }
}

assert {
  res.status: eq 200
}

GraphQL Features

Write queries to fetch data and mutations to modify data. The editor provides syntax highlighting for GraphQL.
Define variables separately in the GraphQLVariables component and reference them in your query using $variableName.
The GraphQLSchemaActions component allows you to fetch and view the GraphQL schema for autocomplete and validation.
Use Bruno variables in GraphQL queries: {{api_url}}, {{user_id}}, etc.

GraphQL with Variables

Query
query GetUser($userId: ID!) {
  user(id: $userId) {
    id
    name
    email
    posts {
      title
      publishedAt
    }
  }
}
Variables
{
  "userId": "{{user_id}}"
}

gRPC Requests

Bruno supports gRPC requests through the GrpcRequestPane component.

Setting Up gRPC

1

Configure Protobuf Files

In Collection Settings, navigate to the “Protobuf” tab and add your .proto files.
2

Create gRPC Request

Create a new request and select “gRPC” as the type.
3

Configure URL

Use the GrpcQueryUrl component to enter the gRPC server address.
4

Select Method

Choose the gRPC method from your protobuf definition.
5

Configure Body

Use the GrpcBody component to provide the request message in JSON format.

gRPC Features

Unary RPC

Single request, single response.

Server Streaming

Single request, stream of responses.

Client Streaming

Stream of requests, single response.

Bidirectional Streaming

Stream of requests and responses.

Protobuf Configuration

In CollectionSettings/Protobuf, configure proto files:
Directory Structure
collection/
├── bruno.json
├── proto/
│   ├── user.proto
│   └── product.proto
└── requests/
    └── get_user.bru
The protobuf configuration allows Bruno to understand message types and provide validation.

WebSocket Requests

Bruno supports WebSocket connections through the WSRequestPane component.

Creating WebSocket Connections

1

Create WebSocket Request

Select “WebSocket” when creating a new request.
2

Enter WebSocket URL

Use the WsQueryUrl component to provide the ws:// or wss:// URL.
3

Configure Settings

Use WSSettingsPane to set connection options.
4

Connect

Click Connect to establish the WebSocket connection.
5

Send Messages

Use the WsBody component to send messages through the connection.

WebSocket Features

Send and receive text or binary messages. The WsBody component handles message composition.
Connect, disconnect, and reconnect to WebSocket servers. Connection state is managed in Redux.
View all sent and received messages in the response pane with timestamps.

WebSocket Example

WebSocket Request
meta {
  name: Chat WebSocket
  type: websocket
}

ws {
  url: wss://echo.websocket.org
}

body:text {
  {
    "type": "message",
    "content": "Hello WebSocket!"
  }
}

Request Type Selection

When creating a request, Bruno determines which pane to display based on the type metadata:
  • type: httpHttpRequestPane
  • type: graphqlGraphQLRequestPane
  • type: grpcGrpcRequestPane
  • type: websocketWSRequestPane
The sidebar uses CollectionItemIcon component to display different icons based on request type.

Advanced Features

Request Chaining

Use post-response scripts to extract data and use it in subsequent requests:
Post-Response Script
const userId = res.body.id;
bru.setVar('user_id', userId);
Then reference in next request:
GET {{api_url}}/users/{{user_id}}/orders

Collection Runner

Run multiple requests in sequence:
1

Right-click Folder

Right-click a folder containing multiple requests.
2

Select 'Run'

Opens the RunCollectionItem modal.
3

Configure Run

Select requests to run and set options (environment, iterations, etc.).
4

View Results

Results are displayed in the RunnerResults component.

Best Practices

Use GraphQL for flexible data fetching, REST for standard CRUD, gRPC for high-performance microservices, and WebSocket for real-time communication.
Create separate folders for different protocols to keep collections organized.
Store base URLs as variables: {{graphql_endpoint}}, {{grpc_host}}, {{ws_url}}.
GraphQL often needs Content-Type: application/json, gRPC may need custom metadata.

Next Steps

Authentication

Configure auth for different request types

Scripts

Add automation to any request type

Tests

Validate responses across all protocols

Collection Settings

Configure protocol-specific settings

Build docs developers (and LLMs) love