Builds either a JSON string body or a FormData multipart body for Telegram Bot API requests.
FormData
Automatically inspects the payload properties for binary InputFile or Blob instances:
Blob
application/json
Key-value map of parameters to send with the Telegram API request.
Object containing the serialized body and optional request headers.
body
headers
const { body, headers } = buildRequestBody({ chat_id: 12345, text: "Hello!" }); Copy
const { body, headers } = buildRequestBody({ chat_id: 12345, text: "Hello!" });
Builds either a JSON string body or a
FormDatamultipart body for Telegram Bot API requests.Automatically inspects the payload properties for binary InputFile or
Blobinstances:FormData.application/jsonheader.