Skip to main content
Glama
buildRequestConfig.ts736 B
/** * Jira API request config builder * This utility builds the RequestInit object for Jira API calls. * It is extracted to keep callJiraApi.ts under 100 lines and to * encapsulate the logic for authentication, headers, and body formatting. * Used by all Jira API HTTP methods to ensure consistency and testability. */ export function buildRequestConfig<TRequestBody>(auth: string, method: string, body?: TRequestBody): RequestInit { const request: RequestInit = { method, headers: { Authorization: `Basic ${auth}`, Accept: 'application/json', 'Content-Type': 'application/json', }, } // Add body for non-GET requests if (body && method !== 'GET') { request.body = JSON.stringify(body) } return request }

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/tbreeding/jira-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server