Installation
Install via NuGet - either via the .NET CLI:
dotnet add package Skybrud.Essentials.Http --version 1.2.0
or the NuGet package manager:
Install-Package Skybrud.Essentials.Http -Version 1.2.0
Changelog
-
Added constructor overload to the
HttpException
class (see ad19505)
TheHttpException
class already had a constructor taking an instance ofIHttpResponse
, but didn't allow specifying a custom exception message. The new constructor overload also take anIHttpResponse
via the first parameter, but then the exception message via the second parameter. -
Dropped .NET Standard 1.3 as a target framework (see ebeeced)
.NET Standard 1.3 probably isn't used that anymore, and supporting it meant a lot of compiler flags, so removing support for .NET Standard 1.3 also helps cleaning up the code. -
Removed all
DoHttp...
style methods (see 1d7110a)
Earlier versions of the package had methods likeDoHttpGetRequest
andDoHttpPostRequest
, which overtime were replaced as the naming felt a bit clumsy. The methods have however remained in the package for legacy support, but as the methods have been marked as obsolete for a long time, and alternatives have existed in the package even longer, it's probably about time to remove the methods. -
Added misc async methods to the
HttpClient
class (see 7262fb5)
TheHttpClient
class have non-async methods likeGet
,Post
and similar. When I added async support to the package, I implemented similar methods for async, but as extension methods. These work fine, but the implementation may not always feel as elegant, so now theHttpClient
class has similarGetAsync
,PostAsync
and similar methods. -
More
HttpClient
parameters should allow null values (see 0e36692)
When support for nullable reference types were introduced to the package, not all parameters were decorated to allow null values. This release adds more nullable decorations to allow null values for parameters where the underlying logic already supports it.