Create a new authenticated HTTP client.
OptionalgetToken: TokenProviderOptional token provider. When supplied, every outgoing
request receives a Bearer token via an Axios request interceptor.
Omit for unauthenticated calls (dev/testing only).
Send an HTTP request and return the parsed response body.
Expected shape of the response body (not validated at runtime).
HTTP method (e.g. "GET", "POST").
Fully-qualified URL to request.
Optionalbody: unknownOptional request body, serialized as JSON.
Additional request options (error handling, headers).
The parsed response body, or undefined if the response has no content
or if returnNullOnNotFound is set and a 404 was received.
Send a GET request to a Bot Service API endpoint.
Expected response body type.
Service URL base (e.g. activity.serviceUrl).
API path (e.g. /v3/conversations).
Optionalparams: Record<string, string | undefined>Optional query string parameters; undefined values are omitted.
Optionaloptions: BotRequestOptionsAdditional request options.
Parsed response body, or undefined.
Send a POST request to a Bot Service API endpoint.
Expected response body type.
Service URL base.
API path.
Optionalbody: unknownRequest body, serialized as JSON.
Optionaloptions: BotRequestOptionsAdditional request options.
Optionalparams: Record<string, string | undefined>Optional query string parameters.
Parsed response body, or undefined.
Send a PUT request to a Bot Service API endpoint.
Expected response body type.
Service URL base.
API path.
Optionalbody: unknownRequest body, serialized as JSON.
Optionaloptions: BotRequestOptionsAdditional request options.
Optionalparams: Record<string, string | undefined>Optional query string parameters.
Parsed response body, or undefined.
Send a DELETE request to a Bot Service API endpoint.
Service URL base.
API path.
Optionalparams: Record<string, string | undefined>Optional query string parameters.
Optionaloptions: BotRequestOptionsAdditional request options.
Authenticated HTTP client for the Bot Service REST API.
Wraps axios and injects a Bearer token via a request interceptor when a TokenProvider is supplied.
Lifecycle note: Create one
BotHttpClientinstance per bot application and reuse it. The request interceptor is attached once in the constructor. Creating many short-lived instances is safe but wasteful — interceptors do not accumulate within a single instance.Response validation: Callers are responsible for validating response shapes. The generic type parameter
Tprovides compile-time convenience but no runtime schema enforcement.