Skip to content

Conversation

@rzikm
Copy link
Member

@rzikm rzikm commented Oct 6, 2022

Summary

Replaced by references to HttpClient or client-agnostic references.

Fixes #7712

@rzikm rzikm requested review from a team as code owners October 6, 2022 11:09
@ghost ghost assigned rzikm Oct 6, 2022
@ghost ghost added the area-System.Net label Oct 6, 2022
@ghost
Copy link

ghost commented Oct 6, 2022

Tagging subscribers to this area: @dotnet/ncl
See info in area-owners.md if you want to be subscribed.

Issue Details

Summary

Replaced by references to HttpClient or client-agnostic references.

Fixes #7712

Author: rzikm
Assignees: rzikm
Labels:

area-System.Net

Milestone: -

@opbld33

This comment was marked as outdated.

@opbld34

This comment was marked as outdated.

@opbld30

This comment was marked as outdated.

@opbld33

This comment was marked as outdated.

@opbld33

This comment was marked as outdated.

@rzikm
Copy link
Member Author

rzikm commented Oct 6, 2022

All remaining snippets build failures are from C++/CLI

@opbld31
Copy link

opbld31 commented Oct 6, 2022

Learn Build status updates of commit e44457b:

✅ Validation status: passed

File Status Preview URL Details
snippets/cpp/VS_Snippets_Remoting/Classic HttpStatusCode Example/CPP/source.cpp ✅Succeeded n/a (file deleted or renamed)
snippets/cpp/VS_Snippets_Remoting/Classic NetworkCredential Example/CPP/source.cpp ✅Succeeded View
snippets/cpp/VS_Snippets_Remoting/Classic Uri Example/CPP/source.cpp ✅Succeeded View
snippets/cpp/VS_Snippets_Remoting/Classic WebProxy Example/CPP/source.cpp ✅Succeeded View
snippets/cpp/VS_Snippets_Remoting/HttpVersion_Version10/CPP/httpversion_version10.cpp ✅Succeeded View
snippets/csharp/System.Net/HttpStatusCode/Overview/source.cs ✅Succeeded n/a (file deleted or renamed)
snippets/csharp/System.Net/HttpVersion/Overview/httpversion_version10.cs ✅Succeeded View
snippets/csharp/System.Net/NetworkCredential/Overview/Project.csproj ✅Succeeded
snippets/csharp/System.Net/NetworkCredential/Overview/source.cs ✅Succeeded View
snippets/csharp/System.Net/WebProxy/Overview/source.cs ✅Succeeded View
snippets/csharp/System/Uri/Overview/source.cs ✅Succeeded View
snippets/fsharp/System/Uri/Overview/source.fs ✅Succeeded View
snippets/visualbasic/VS_Snippets_Remoting/Classic HttpStatusCode Example/VB/source.vb ✅Succeeded n/a (file deleted or renamed)
snippets/visualbasic/VS_Snippets_Remoting/Classic NetworkCredential Example/VB/Project.vbproj ✅Succeeded
snippets/visualbasic/VS_Snippets_Remoting/Classic NetworkCredential Example/VB/source.vb ✅Succeeded View
snippets/visualbasic/VS_Snippets_Remoting/Classic Uri Example/VB/Project.vbproj ✅Succeeded
snippets/visualbasic/VS_Snippets_Remoting/Classic Uri Example/VB/source.vb ✅Succeeded View
snippets/visualbasic/VS_Snippets_Remoting/Classic WebProxy Example/VB/Project.vbproj ✅Succeeded
snippets/visualbasic/VS_Snippets_Remoting/Classic WebProxy Example/VB/source.vb ✅Succeeded View
snippets/visualbasic/VS_Snippets_Remoting/HttpVersion_Version10/VB/httpversion_version10.vb ✅Succeeded View
snippets/visualbasic/VS_Snippets_Remoting/HttpVersion_Version10/VB/Project.vbproj ✅Succeeded
xml/ns-System.Net.xml ✅Succeeded View
xml/System.Net.Security/SslStream.xml ✅Succeeded View
xml/System.Net/HttpListener.xml ✅Succeeded View
xml/System.Net/HttpStatusCode.xml ✅Succeeded View

This comment lists only the first 25 files in the pull request.
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.

This is super, thanks @rzikm!

…tpversion_version10.cpp

Co-authored-by: Ahmet İbrahim AKSOY <aaksoy@microsoft.com>
@rzikm rzikm enabled auto-merge (squash) October 7, 2022 10:57
@opbld31
Copy link

opbld31 commented Oct 7, 2022

Learn Build status updates of commit 2df4c11:

✅ Validation status: passed

File Status Preview URL Details
snippets/cpp/VS_Snippets_Remoting/Classic HttpStatusCode Example/CPP/source.cpp ✅Succeeded n/a (file deleted or renamed)
snippets/cpp/VS_Snippets_Remoting/Classic NetworkCredential Example/CPP/source.cpp ✅Succeeded View
snippets/cpp/VS_Snippets_Remoting/Classic Uri Example/CPP/source.cpp ✅Succeeded View
snippets/cpp/VS_Snippets_Remoting/Classic WebProxy Example/CPP/source.cpp ✅Succeeded View
snippets/cpp/VS_Snippets_Remoting/HttpVersion_Version10/CPP/httpversion_version10.cpp ✅Succeeded View
snippets/csharp/System.Net/HttpStatusCode/Overview/source.cs ✅Succeeded n/a (file deleted or renamed)
snippets/csharp/System.Net/HttpVersion/Overview/httpversion_version10.cs ✅Succeeded View
snippets/csharp/System.Net/NetworkCredential/Overview/Project.csproj ✅Succeeded
snippets/csharp/System.Net/NetworkCredential/Overview/source.cs ✅Succeeded View
snippets/csharp/System.Net/WebProxy/Overview/source.cs ✅Succeeded View
snippets/csharp/System/Uri/Overview/source.cs ✅Succeeded View
snippets/fsharp/System/Uri/Overview/source.fs ✅Succeeded View
snippets/visualbasic/VS_Snippets_Remoting/Classic HttpStatusCode Example/VB/source.vb ✅Succeeded n/a (file deleted or renamed)
snippets/visualbasic/VS_Snippets_Remoting/Classic NetworkCredential Example/VB/Project.vbproj ✅Succeeded
snippets/visualbasic/VS_Snippets_Remoting/Classic NetworkCredential Example/VB/source.vb ✅Succeeded View
snippets/visualbasic/VS_Snippets_Remoting/Classic Uri Example/VB/Project.vbproj ✅Succeeded
snippets/visualbasic/VS_Snippets_Remoting/Classic Uri Example/VB/source.vb ✅Succeeded View
snippets/visualbasic/VS_Snippets_Remoting/Classic WebProxy Example/VB/Project.vbproj ✅Succeeded
snippets/visualbasic/VS_Snippets_Remoting/Classic WebProxy Example/VB/source.vb ✅Succeeded View
snippets/visualbasic/VS_Snippets_Remoting/HttpVersion_Version10/VB/httpversion_version10.vb ✅Succeeded View
snippets/visualbasic/VS_Snippets_Remoting/HttpVersion_Version10/VB/Project.vbproj ✅Succeeded
xml/ns-System.Net.xml ✅Succeeded View
xml/System.Net.Security/SslStream.xml ✅Succeeded View
xml/System.Net/HttpListener.xml ✅Succeeded View
xml/System.Net/HttpStatusCode.xml ✅Succeeded View

This comment lists only the first 25 files in the pull request.
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:

@rzikm rzikm merged commit a48dd56 into dotnet:main Oct 7, 2022
Console.WriteLine("Request version after assignment is {0}", request.Version);

HttpResponseMessage response = client.Send(request);
Console.WriteLine("Response HTTP version {0}", response.Version);
Copy link
Member

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.)
Copy link
Member

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.
Copy link
Member

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.

rzikm added a commit to rzikm/dotnet-api-docs that referenced this pull request Oct 10, 2022
rzikm added a commit to rzikm/dotnet-api-docs that referenced this pull request Nov 7, 2022
rzikm added a commit that referenced this pull request Nov 7, 2022
* Feedback from #8467

* Feedback from #8482

* Feedback from #8484

* Feedback from #8460

* More fixes
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.

Scrub references to WebRequest

8 participants