From 64023f1bf418a44eef3f8a6cb0c163bea213d495 Mon Sep 17 00:00:00 2001 From: "mintlify[bot]" <109931778+mintlify[bot]@users.noreply.github.com> Date: Mon, 4 May 2026 05:09:08 +0000 Subject: [PATCH] docs(websocket): document multi-message support Generated-By: mintlify-agent --- send-requests/websocket/create-request.mdx | 6 ++++ send-requests/websocket/message-types.mdx | 2 ++ send-requests/websocket/overview.mdx | 2 ++ send-requests/websocket/ws-interface.mdx | 41 +++++++++++++++++++--- 4 files changed, 46 insertions(+), 5 deletions(-) diff --git a/send-requests/websocket/create-request.mdx b/send-requests/websocket/create-request.mdx index 0291f895..58976424 100644 --- a/send-requests/websocket/create-request.mdx +++ b/send-requests/websocket/create-request.mdx @@ -100,3 +100,9 @@ Bruno allows you to override other `Sec-WebSocket-*` headers if needed for testi Simply add these headers in the Headers tab like any other custom header. +## Adding Multiple Messages + +A WebSocket request in Bruno can hold more than one message. After creating the request, open the **Body** tab and use the `+` icon in the toolbar to add additional messages. Each message has its own name, type (Text, JSON, or XML), and payload, and any one of them can be sent at a time. + +For details on the message editor, type selection, and send behavior, see the [Request Interface](./ws-interface) page. + diff --git a/send-requests/websocket/message-types.mdx b/send-requests/websocket/message-types.mdx index 5fcf707d..cf4fe016 100644 --- a/send-requests/websocket/message-types.mdx +++ b/send-requests/websocket/message-types.mdx @@ -5,6 +5,8 @@ sidebarTitle: "Message Types" Bruno supports various message types for WebSocket communication, allowing you to send and receive different data formats based on your application's requirements. +When a request contains multiple messages, the type is set per message — you can mix Text, JSON, and XML messages within the same WebSocket request. New messages default to **JSON**. + ## Supported Message Types Bruno supports the following WebSocket message types: diff --git a/send-requests/websocket/overview.mdx b/send-requests/websocket/overview.mdx index 10b9082b..beb3ff46 100644 --- a/send-requests/websocket/overview.mdx +++ b/send-requests/websocket/overview.mdx @@ -8,6 +8,8 @@ title: "Overview" Bruno now supports WebSocket connections, enabling you to test real-time communication protocols and bidirectional data exchange. This feature allows you to establish WebSocket connections, send messages, and receive responses in real-time. +A single WebSocket request can hold multiple named messages — each with its own type and payload — so you can keep all the message variants for an endpoint together and send them on demand. + ## What are WebSockets? WebSockets provide a persistent, full-duplex communication channel between a client and server. Unlike traditional HTTP requests that follow a request-response pattern, WebSockets maintain an open connection that allows both the client and server to send messages at any time. diff --git a/send-requests/websocket/ws-interface.mdx b/send-requests/websocket/ws-interface.mdx index 052c008c..22fe4b75 100644 --- a/send-requests/websocket/ws-interface.mdx +++ b/send-requests/websocket/ws-interface.mdx @@ -16,9 +16,23 @@ The WebSocket request interface consists of several key components: - **Disconnected**: Connection lost or manually closed ### Message Composition -- **Message Type**: Choose between Text, JSON, XML -- **Message Editor**: Compose your message with syntax highlighting -- **Send Button**: Send the composed message + +Bruno organizes WebSocket messages as a list of collapsible accordion panels, so you can save multiple reusable messages alongside a single request and send any one of them on demand. + +Each message panel includes: + +- **Message name**: Double-click the label to rename a message inline +- **Message type**: Switch between Text, JSON, and XML per message +- **Message editor**: Compose the payload with syntax highlighting +- **Send button** (per message): Send that specific message; auto-connects if the WebSocket is not yet connected +- **Delete button**: Remove the message (available when the request has more than one message) + +The body tab also exposes two toolbar actions in the top-right: + +- **Add Message** (`+`): Append a new message; new messages default to JSON and auto-expand for editing +- **Prettify All** (wand icon): Format every JSON and XML message in the request + +The currently selected message (highlighted; others appear dimmed) is the one that will be sent when you click the global **Send** button at the top of the request. ### Message History - **Sent Messages**: All messages you've sent (marked with →) @@ -37,12 +51,29 @@ The WebSocket request interface consists of several key components: ### Sending Messages 1. **Compose your message** in the message editor -2. **Select message type** (Text, JSON, XML) -3. **Click "Send"** to transmit the message +2. **Select the message type** (Text, JSON, XML) for that message +3. **Send the message** in one of two ways: + - Click the per-message **Send** button on a specific message panel to send that message + - Click the global **Send** button at the top of the request to send the currently selected message 4. **View sent message** in the message history +If the WebSocket connection is not yet open, sending a message will auto-connect first. + ![Send WebSocket Request](/images/screenshots/send-request/ws/send-ws-req.webp) +### Working With Multiple Messages + +You can store multiple messages in a single WebSocket request, which is useful for testing different payload variants without creating separate requests. + +1. **Add a message**: Click the `+` icon in the body tab toolbar (or the **Add message** link if the request has none). New messages default to JSON. +2. **Rename a message**: Double-click the message name in the accordion header and press Enter to save. +3. **Switch types per message**: Use the type selector in each message panel to change between Text, JSON, and XML independently. +4. **Select the active message**: Click any message panel to select it; the selected message is what the global **Send** button transmits. +5. **Prettify all**: Click the wand icon in the body tab toolbar to format every JSON and XML message at once. +6. **Delete a message**: Hover the message header and click the trash icon. The delete control is hidden when only one message exists. + +Multi-message support is preserved across both `.bru` and `.yml` collection formats, so saved requests round-trip without losing message names, types, or selection state. + ### Receiving Messages 1. **Monitor the message history** for incoming messages