Skip to content

Updated HttpClient main topic to address user feedback from issues. #3986

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 15 commits into from
May 20, 2022

Conversation

samsp-msft
Copy link
Contributor

Summary

Added more detail about the behavior and usage of HttpClient trying to address user feedback and confusion.

Fixes dotnet/docs#11901
Fixes /issues/3523
Fixes /issues/1518
Fixes /issues/3276
Fixes /issues/1326

@samsp-msft samsp-msft requested a review from a team as a code owner March 13, 2020 00:56
@dotnet-bot dotnet-bot added this to the March 2020 milestone Mar 13, 2020
@samsp-msft
Copy link
Contributor Author

@davidsh @scalablecory @karelz @stephentoub Please review

@carlossanlop
Copy link
Contributor

@dotnet/ncl can someone please review this PR?

@BillWagner BillWagner modified the milestones: March 2020, June 2020 Jun 1, 2020
@aik-jahoda aik-jahoda self-requested a review July 9, 2020 11:53
@gewarren
Copy link
Contributor

@samsp-msft Can you incorporate/respond to the feedback when you get a chance?

@carlossanlop
Copy link
Contributor

@scalablecory @aik-jahoda can you please take a look again and approve if it looks good?

9. <xref:System.Net.Http.HttpClient.SendAsync%2A>

<xref:System.Net.Http.HttpClient> is intended to be instantiated once and re-used throughout the life of an application. Instantiating an HttpClient class for every request will exhaust the number of sockets available under heavy loads. This will result in SocketException errors. Below is an example using HttpClient correctly.
<xref:System.Net.Http.HttpClient> is intended to be instantiated once and re-used throughout the life of an application. HttpClient is designed to pool connections, and re-use a connection across multiple requests. Instantiating an HttpClient class for every request will exhaust the number of sockets available under heavy loads. This will result in SocketException errors. Below is an example using HttpClient correctly.
Copy link
Member

Choose a reason for hiding this comment

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

This will result in SocketException errors.

Though they'll be wrapped when actually emerging into user code, right? e.g. in an HttpRequestException?

@carlossanlop
Copy link
Contributor

@samsp-msft will you have a chance to address the latest suggestions? There's also a merge conflict to fix.

Base automatically changed from master to main March 5, 2021 20:52
@danmoseley
Copy link
Member

@samsp-msft just in case you missed the ping, it looks like it would be valuable to get merged 😀

@opbld34

This comment was marked as outdated.

@opbld33

This comment was marked as outdated.

@jeffhandley jeffhandley modified the milestones: June 2020, Backlog Apr 29, 2022
Copy link
Contributor

@gewarren gewarren left a comment

Choose a reason for hiding this comment

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

@samsp-msft I left some suggestions mostly around active voice. LMK if you want me to commit them for you. It would be great to get this merged today.

@opbld30
Copy link

opbld30 commented May 20, 2022

Docs Build status updates of commit 19922bc:

✅ Validation status: passed

File Status Preview URL Details
xml/System.Net.Http/HttpClient.xml ✅Succeeded View

For more details, please refer to the build report.

Note: Broken links written as relative paths are included in the above build report. For broken links written as absolute paths or external URLs, see the broken link report.

For any questions, please:

Copy link
Contributor

@gewarren gewarren left a comment

Choose a reason for hiding this comment

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

LGTM

@opbld34

This comment was marked as outdated.

@opbld31

This comment was marked as outdated.

@opbld34
Copy link

opbld34 commented May 20, 2022

Docs Build status updates of commit 89367bb:

✅ Validation status: passed

File Status Preview URL Details
xml/System.Net.Http/HttpClient.xml ✅Succeeded View

For more details, please refer to the build report.

Note: Broken links written as relative paths are included in the above build report. For broken links written as absolute paths or external URLs, see the broken link report.

For any questions, please:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet