Skip to main content
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:

Text Messages

Plain text messages for simple communication and human-readable data exchange. Characteristics:
  • Format: UTF-8 encoded text
  • Use Case: Simple messages, commands, status updates
  • Size: Limited by WebSocket frame size (typically 64KB)
  • Encoding: UTF-8
Example Text Messages:
When to Use:
  • Simple commands or instructions
  • Status messages and notifications
  • Human-readable communication
  • Protocol-level messages (PING/PONG)

JSON Messages

Structured data in JSON format for complex data exchange and API-like communication. Characteristics:
  • Format: JSON (JavaScript Object Notation)
  • Use Case: Structured data, API responses, complex objects
  • Validation: JSON syntax validation and formatting
  • Size: Limited by WebSocket frame size
Example JSON Messages:
Chat Application Example:
API Response Example:
When to Use:
  • Structured data exchange
  • API-like communication
  • Complex objects and arrays
  • When you need data validation

XML Messages

Structured data in XML format for legacy systems and XML-based protocols. Characteristics:
  • Format: XML (eXtensible Markup Language)
  • Use Case: SOAP messages, legacy systems, XML-based APIs
  • Validation: XML syntax validation and formatting
  • Size: Limited by WebSocket frame size
Example XML Messages:
SOAP Message Example:
When to Use:
  • Legacy systems requiring XML format
  • SOAP-based WebSocket services
  • XML-based messaging protocols
  • When working with systems that expect XML