mithril icon indicating copy to clipboard operation
mithril copied to clipboard

Custom headers in mithril client

Open slowbackspace opened this issue 1 year ago • 0 comments

Hello! We are in the process of integrating the Mithril Aggregator API into the Blockfrost API. We would like our users to be able to use the official mithril-client with custom URL pointing to our proxy for Mithril API. However, to access Blockfrost endpoints, users need to authenticate by sending a header with their API key. For this, we need a way to add a custom header to requests sent by mithril-client. Additionally, this could be also useful to control caching or to set a custom user-agent to make monitoring a little bit easier.

Would it be possible to expose access to the headers sent by mithril-client, perhaps by allowing a headers object to be passed during client initialization? We’ll gladly submit a PR to implement this feature.

Thank you!

slowbackspace avatar May 30 '24 12:05 slowbackspace