Defjs
Core

WebSocketRequestShape

Request shape the builder of a WebSocketDefinition may return, where P is the endpoint path.

@defjs/core · Type

Signature

type WebSocketRequestShape<P extends string> = {
  body?: never;
  headers?: never;
  path?: PathValue<P>;
  query?: URLSearchParams | QueryRecord;
};
  • path supplies the :name segments of P: one scalar value per name. It is never when the path has none.
  • query is a URLSearchParams or a record of scalars, arrays, and nested records.
  • headers and body are never. A WebSocket handshake takes neither from the builder; put credentials in beforeConnect or an interceptor.

Members

Prop

Type

body? undefined

WebSocket handshakes cannot have a body. Use session.send after connecting.

headers? undefined

WebSocket builders cannot set handshake headers.

path? PathValue<P> | undefined

Explicit values for path placeholders. Anonymous objects use template keys; typed objects apply their struct aliases.

query? QueryRecord | URLSearchParams | undefined

URLSearchParams passes through unchanged; objects are encoded first. Configure the Client's query serializer for nested query values.

Edit this page on GitHub
Released under the MIT License. · Copyright © 2026 MunMunMiao