-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Scrub references to WebRequest from examples #8467
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
Conversation
|
Tagging subscribers to this area: @dotnet/ncl Issue DetailsSummaryReplaced by references to HttpClient or client-agnostic references. Fixes #7712
|
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
|
All remaining snippets build failures are from C++/CLI |
gewarren
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is super, thanks @rzikm!
snippets/cpp/VS_Snippets_Remoting/HttpVersion_Version10/CPP/httpversion_version10.cpp
Outdated
Show resolved
Hide resolved
…tpversion_version10.cpp Co-authored-by: Ahmet İbrahim AKSOY <aaksoy@microsoft.com>
|
Learn Build status updates of commit 2df4c11: ✅ Validation status: passed
This comment lists only the first 25 files in the pull request. 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:
|
| Console.WriteLine("Request version after assignment is {0}", request.Version); | ||
|
|
||
| HttpResponseMessage response = client.Send(request); | ||
| Console.WriteLine("Response HTTP version {0}", response.Version); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The HttpClient instead and the HttpResponseMessage should both be disposed / should both be in using blocks / declarations.
| ## Examples | ||
| The following code example assigns a <xref:System.Net.WebProxy> instance to a <xref:System.Net.WebRequest> instance. The <xref:System.Net.WebRequest> instance uses the proxy to connect to external Internet resources. (For an example that demonstrates using the WPAD feature, see the documentation for the <xref:System.Net.IWebProxyScript> class.) | ||
| The following code example sets up <xref:System.Net.Http.HttpClient> instance with a <xref:System.Net.WebProxy> instance. The <xref:System.Net.Http.HttpClient> instance uses the proxy to connect to external Internet resources. (For an example that demonstrates using the WPAD feature, see the documentation for the <xref:System.Net.IWebProxyScript> class.) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
sets up HttpClient instance
"sets up an HttpClient instance"
| ## Remarks | ||
| The <xref:System.Net.WebProxy.GetDefaultProxy%2A> method reads the nondynamic proxy settings stored by Internet Explorer 5.5 and later, and creates a <xref:System.Net.WebProxy> instance with those settings. | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
GetDefaultProxy throws PlatformNotSupportedException on .NET Core.
Summary
Replaced by references to HttpClient or client-agnostic references.
Fixes #7712