Document HttpClient configuration for IDownstreamApi#3690
Draft
Document HttpClient configuration for IDownstreamApi#3690
Conversation
…eamApi Co-authored-by: jmprieur <13203188+jmprieur@users.noreply.github.com>
Co-authored-by: jmprieur <13203188+jmprieur@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Add documentation for configuring HttpClient in IDownstreamApi
Document HttpClient configuration for IDownstreamApi
Jan 30, 2026
jmprieur
reviewed
Feb 4, 2026
|
|
||
| ## Configuring the Underlying HttpClient | ||
|
|
||
| `IDownstreamApi` uses `IHttpClientFactory` internally to create `HttpClient` instances. By default, it creates a named client using the service name you specify (e.g., "MyApi"). You can customize this `HttpClient` by registering it with `IHttpClientFactory` using the same name. |
Collaborator
There was a problem hiding this comment.
This should be in the downstream APIs article? Not this one? Or should it. What do you think @copilot ?
Contributor
Author
There was a problem hiding this comment.
I placed it in custom-apis.md because:
- Detailed implementation guidance: The section provides in-depth examples (logging handlers, Polly integration, debugging scenarios) which align with the detailed nature of
custom-apis.md - IDownstreamApi focus: The content is specifically about IDownstreamApi with custom APIs, which is the subject of this document
- README is high-level: The
calling-downstream-apis-README.mdserves as an overview/decision guide with quick starts, while detailed "how-to" content belongs in the specific guides
However, I can move it to the main README if you prefer. The README's IDownstreamApi section currently has a quick start example, and this could be added as an advanced configuration subsection there. What would you prefer?
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
IDownstreamApi uses IHttpClientFactory internally but lacked documentation on customizing the underlying HttpClient (timeouts, handlers, retry policies). Users discovered the pattern empirically: register a named HttpClient matching the downstream API service name.
Changes
Added section "Configuring the Underlying HttpClient" to
docs/calling-downstream-apis/custom-apis.md:Explains IHttpClientFactory integration and named client mapping
Basic configuration example:
Advanced scenarios:
Best practices (timeout values, handler composition, BaseUrl vs BaseAddress)
Updated
docs/calling-downstream-apis/calling-downstream-apis-README.md:Original prompt
💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.