Open mgm1313 opened 2 weeks ago
I'd like a straightforward way to set default headers for requests. This is important for us because we use headers like Accept-Language and User-Agent for analytical purposes, among other things.
Accept-Language
User-Agent
The api could extend the one proposed in #110 :
export async function createAgent({ domain, locale, }: AgentProps) { const baseUrl = someLogicToDetermineBaseUrl(domain); const userAgent = getVersionString() const agent = new sdk.client({ defaultConfiguration: { baseUrl: new URL(baseUrl), headers: { 'Accept-Language': locale, 'User-Agent': userAgent, } } }); return agent; }
I'd like a straightforward way to set default headers for requests. This is important for us because we use headers like
Accept-Language
andUser-Agent
for analytical purposes, among other things.The api could extend the one proposed in #110 :