dotnet / dotnet/dotnet-api-docs
Example code in ITypedHttpClientFactory<TClient> Interface page is broken
- Dominant language
- C#
- Stars
- 949
- Forks
- 1.7k
- Avg merge
- 3d 27m
- Merged PRs (30d)
- 49
Description
https://github.com/dotnet/dotnet-api-docs/blob/main/xml/Microsoft.Extensions.Http/ITypedHttpClientFactory%601.xml
```c#
// in Controllers/HomeController.cs
public class HomeController : ControllerBase(IApplicationBuilder app, ExampleClient exampleClient)
{
private readonly ExampleClient _exampleClient;
public HomeController(ExampleClient exampleClient)
{
_exampleClient = exampleClient;
}
public async Task Index()
{
var response = await _exampleClient.GetAsync("/helloworld");
var text = await response.Content.ReadAsStringAsync();
return Content("Remote server said: " + text, "text/plain");
};
}
```
1.) I don't think the `ControllerBase(IApplicationBuilder app, ExampleClient exampleClient)` syntax exists
2.) `ExampleClient` does not have a `GetAsync` method
3.) semicolon after `Index()`'s method body
Contributor guide
Assessment
This issue has not been assessed yet.