question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Changing ApiKey and DataCenter does not change request URLs

See original GitHub issue

I have a .NET Core application that iterates over multiple API Keys that exist in separate data centers. When switching between API keys the underlying data center component of request URLs does not change. The code does not re-use the same MailChimpManager, an entirely new copy is instantiated for each API Key used.

Having looked at the code for BaseLogic.cs my guess is has something to do with the use of the static IHttpClientFactory.

Whilst I don’t pretend to fully follow the code, on line 40 the call:

client.BaseAddress = new Uri(GetBaseAddress());               

Would appear to run when _httpClientFactory is instantiated and therefore the initial values of the base URL would persist for the lifetime of the application.

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:8 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
Uffmancommented, Nov 11, 2020

I have the same problem. Reverted to preview version 4.2.1 because of this

0reactions
Uffmancommented, Apr 21, 2021

I upgraded today and so far so good 😉

Read more comments on GitHub >

github_iconTop Results From Across the Web

Authenticate by using API keys
API-first integration to connect existing data and applications. ... Solution to bridge existing care systems and apps on Google Cloud. ... No-code development ......
Read more >
Passing API key with HTTP header in cURL
When I modify my policy to look for the key in query parameter rather than the header, it works fine. Am I missing...
Read more >
Configure API Key Lifetime
If you have just set a key lifetime and want to reset all API keys to adhere to the new term, you can...
Read more >
Updating endpoint URLs from watsonplatform.net
Watson API endpoint URLs at watsonplatform.net are changing and will not work after they are retired. Update your calls to use the newer...
Read more >
API security best practices | Google Maps Platform
Learn how to secure and manage your Google Maps Platform API keys.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found