Skip to main content

Headers

Echo back the request headers your client actually sent to Market Data. Useful for debugging proxies, custom header plumbing, or verifying the User-Agent the SDK is presenting.

The Authorization header is redacted server-side before the response is returned.

Making Requests

Use the headers() method on the utilities resource.

Output FormatResult PayloadDescription
internal (default)HeadersResponseMap of header name to value as the API saw it.
jsonRaw JSON objectThe raw response as returned by the API.

headers

headers(): MarketDataPromise<HeadersResponse>

Fetches the request-header echo. Takes no parameters.

Returns

import { MarketDataClient } from "@marketdata/sdk";

const client = new MarketDataClient();

try {
const h = await client.utilities.headers();
console.log(h["user-agent"]); // "marketdata-sdk-js/1.0.0"
console.log(h["accept-encoding"]);
} catch (error) {
console.error(error);
}

HeadersResponse

type HeadersResponse = Record<string, unknown>;

A bag of header name → value pairs. Header names are lowercased; values may be strings or arrays of strings depending on whether the header was sent multiple times.

tip

Use this to confirm what gets through when you wire the SDK behind a corporate proxy or add custom headers via your runtime's fetch interception.