Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Jan 28, 2026

The "Generated clients" section states that AddRefitClient<T> registers a typed client, but the code comment incorrectly referred to it as a named client.

Change:

  • Updated comment in /docs/core/extensions/snippets/http/generated/Program.cs to correctly identify the client type
 builder.Services.AddRefitClient<ITodoService>()
     .ConfigureHttpClient(client =>
     {
-        // Set the base address of the named client.
+        // Set the base address of the typed client.
         client.BaseAddress = new Uri("https://jsonplaceholder.typicode.com/");

This aligns the code comment with the documentation's description of Refit-generated clients as typed clients.

Original prompt

This section details on the original issue you should resolve

<issue_title>comment in code example doesn't match the docs for the IHttpClientFactory</issue_title>
<issue_description>### Type of issue

Typo

Description

In the section for the Generated clients the docs says

A typed client can be added, using Refit to generate the implementation

And the code example underneath it says its a named client when setting the base address

builder.Services.AddRefitClient<ITodoService>()
    .ConfigureHttpClient(client =>
    {
        // Set the base address of the named client.
        client.BaseAddress = new Uri("https://jsonplaceholder.typicode.com/");

        // Add a user-agent default request header.
        client.DefaultRequestHeaders.UserAgent.ParseAdd("dotnet-docs");
    });

Page URL

https://learn.microsoft.com/en-us/dotnet/core/extensions/httpclient-factory

Content source URL

https://github.com/dotnet/docs/blob/main/docs/core/extensions/httpclient-factory.md

Document Version Independent Id

33db41be-42f9-bb94-65fe-0cf7d1c64f12

Platform Id

c667850f-a5ec-d80b-d8af-0c1c1e37e599

Article author

@IEvangelist

Metadata

  • ID: 46af0b96-2d12-9cac-2f8f-15eb49d0292d
  • PlatformId: c667850f-a5ec-d80b-d8af-0c1c1e37e599
  • Service: dotnet-fundamentals

Related Issues</issue_description>

Comments on the Issue (you are @copilot in this section)


💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.

Copilot AI changed the title [WIP] Fix typo in IHttpClientFactory code example Fix comment in Generated clients example to say "typed client" Jan 28, 2026
Copilot AI requested a review from gewarren January 28, 2026 23:14
@gewarren gewarren marked this pull request as ready for review January 29, 2026 15:44
@gewarren gewarren requested a review from a team as a code owner January 29, 2026 15:44
Copilot AI review requested due to automatic review settings January 29, 2026 15:44
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot wasn't able to review any files in this pull request.

@gewarren gewarren enabled auto-merge (squash) January 29, 2026 15:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

comment in code example doesn't match the docs for the IHttpClientFactory

2 participants