Skip to content
tRPC

Partners

Type Alias: HTTPBatchStreamLinkOptions<TRoot>

On this page

HTTPBatchStreamLinkOptions<TRoot>: HTTPBatchLinkOptions<TRoot> & object

Defined in: packages/client/src/links/httpBatchStreamLink.ts:27

Options for httpBatchStreamLink. Takes the same options as httpBatchLink, plus streamHeader.

Type declaration

streamHeader?

optional streamHeader: "trpc-accept" | "accept"

Which header to use to signal the server that the client wants a streaming response.

  • 'trpc-accept' (default): sends trpc-accept: application/jsonl header
  • 'accept': sends Accept: application/jsonl header, which can avoid CORS preflight for cross-origin streaming queries. Be aware that application/jsonl is not an official MIME type and so this is not completely spec-compliant - you should test that your infrastructure supports this value.

Default

'trpc-accept'

Type Parameters

Type Parameter
TRoot extends AnyClientTypes

See

https://trpc.io/docs/client/links/httpBatchStreamLink#options