smartystreets / smartystreets-dotnet-sdk

The official client libraries for accessing SmartyStreets APIs from .Net (C# and CLR-based languages)
https://smartystreets.com/docs/sdk/dotnet
Apache License 2.0
22 stars 20 forks source link

Convert NativeSender from using WebRequest to HttpClient #6

Closed StevenBarnettST closed 6 years ago

StevenBarnettST commented 6 years ago

Using this library in a .NET Core 2.0 program, I was receiving the following error:

System.PlatformNotSupportedException: Operation is not supported on this platform.
   at System.Net.SystemWebProxy.GetProxy(Uri destination)

This PR swaps out WebRequest for HttpClient, as generally suggested by the .NET team, eliminating the error.

Note: I have not tested the proxy code path.

joliver commented 6 years ago

It looks like the error you received was related a bug in .NET Core 2: https://github.com/restsharp/RestSharp/issues/1061

That bug has now been fixed.

joliver commented 6 years ago

If this isn't the case, we'll take a stronger look at HttpClient.