dotnet / dotnet/dotnet-api-docs

Document which HttpClient methods are thread-safe, on class page and individual method pages

Open
#12,711 1 comment 0 reactions 0 assignees View on GitHub
area-System.Net untriaged
Dominant language
C#
Stars
949
Forks
1.7k
Avg merge
3d 27m
Merged PRs (30d)
49

Description

### Type of issue

Missing information

### Description

There is a supplemental page, "[System.Net.Http.HttpClient class](https://learn.microsoft.com/en-us/dotnet/fundamentals/runtime-libraries/system-net-http-httpclient#thread-safety)" under dotnet/fundamentals, which has a "Thread safety" section listing which methods of HttpClient are thread-safe.

Please also add this information on the main API [class page](https://learn.microsoft.com/en-us/dotnet/api/system.net.http.httpclient?view=net-10.0) and the individual method pages (at least for the methods like [SendAsync](https://learn.microsoft.com/en-us/dotnet/api/system.net.http.httpclient.sendasync?view=net-10.0) that **are** thread-safe, optionally noting those that **aren't**).

It is normal for `` notes to be on the API class and method pages, not just supplemental pages.

Thread safety is important because the documentation lists "a static or singleton HttpClient instance" as one of the [recommended ways](https://learn.microsoft.com/en-us/dotnet/fundamentals/networking/http/httpclient-guidelines#recommended-use) to use HttpClient.

### Page URL

https://learn.microsoft.com/en-us/dotnet/api/system.net.http.httpclient.sendasync?view=net-10.0

### Content source URL

https://github.com/dotnet/dotnet-api-docs-temp/blob/live/xml/System.Net.Http/HttpClient.xml

### Document Version Independent Id

4c6655b6-94ea-76b2-38c7-4321577461a2

### Platform Id

f8bd6c46-3619-3355-a567-f83eaf381aef

### Article author

@karelz

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.