HTTP/REST Requests
HTTP requests are the most common type in Bruno, managed by theHttpRequestPane component.
Supported HTTP Methods
- GET
- POST
- PUT/PATCH
- DELETE
Retrieve resources from the server.
Request Body Types
TheRequestBody 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
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 theGraphQLRequestPane component.
Creating GraphQL Requests
GraphQL Query Example
From the test suite:Example from bruno-tests/collection/graphql/spacex.bru
GraphQL Features
Query & Mutation Support
Query & Mutation Support
Write queries to fetch data and mutations to modify data. The editor provides syntax highlighting for GraphQL.
Variables
Variables
Define variables separately in the
GraphQLVariables component and reference them in your query using $variableName.Schema Introspection
Schema Introspection
The
GraphQLSchemaActions component allows you to fetch and view the GraphQL schema for autocomplete and validation.Variable Interpolation
Variable Interpolation
Use Bruno variables in GraphQL queries:
{{api_url}}, {{user_id}}, etc.GraphQL with Variables
Query
Variables
gRPC Requests
Bruno supports gRPC requests through theGrpcRequestPane component.
Setting Up gRPC
Configure Protobuf Files
In Collection Settings, navigate to the “Protobuf” tab and add your
.proto files.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
InCollectionSettings/Protobuf, configure proto files:
Directory Structure
WebSocket Requests
Bruno supports WebSocket connections through theWSRequestPane component.
Creating WebSocket Connections
WebSocket Features
Message Types
Message Types
Send and receive text or binary messages. The
WsBody component handles message composition.Connection Management
Connection Management
Connect, disconnect, and reconnect to WebSocket servers. Connection state is managed in Redux.
Message History
Message History
View all sent and received messages in the response pane with timestamps.
WebSocket Example
WebSocket Request
Request Type Selection
When creating a request, Bruno determines which pane to display based on thetype metadata:
type: http→HttpRequestPanetype: graphql→GraphQLRequestPanetype: grpc→GrpcRequestPanetype: websocket→WSRequestPane
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
Collection Runner
Run multiple requests in sequence:Best Practices
Choose the Right Type
Choose the Right Type
Use GraphQL for flexible data fetching, REST for standard CRUD, gRPC for high-performance microservices, and WebSocket for real-time communication.
Organize by Protocol
Organize by Protocol
Create separate folders for different protocols to keep collections organized.
Use Variables for Endpoints
Use Variables for Endpoints
Store base URLs as variables:
{{graphql_endpoint}}, {{grpc_host}}, {{ws_url}}.Document Protocol-Specific Headers
Document Protocol-Specific Headers
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