Skip to content

WebSockets and server-sent events

Streaming requests use the JetBrains syntax. Instead of Send, they have Connect, and the response area becomes a live log of messages, with Disconnect, Clear and Copy.

### Price feed
WEBSOCKET wss://feed.example.com/prices
Authorization: Bearer {{$auth.token("my-api")}}
{ "subscribe": "EURUSD" }
=== wait-for-server
{ "subscribe": "GBPUSD" }
  • The body’s messages are sent in order once connected. === separates them, and === wait-for-server waits for a message from the server before sending the next one.
  • Type more messages in the box below the log and press Send (or Ctrl+Enter).
  • JSON messages are shown indented.
  • Headers, Sec-WebSocket-Protocol, variables, OAuth tokens and the environment’s certificate settings all apply.
A WebSocket request connected to an echo server, with the messages sent and received in a live logA WebSocket request connected to an echo server, with the messages sent and received in a live log
A WebSocket connection's live log of messages.
### Notifications
GET {{baseUrl}}/notifications
Accept: text/event-stream

Any request with Accept: text/event-stream is read as it arrives, one event per entry. Multi-line data: fields are joined, and the event: type is shown.

Streams stay open until you disconnect, so Run all and reqjet run skip them, reporting them as not run, rather than waiting forever. Script files can’t send them.