Releases: skybrud/Skybrud.Essentials.Http
v1.2.2
Installation
Install via NuGet - either via the .NET CLI:
dotnet add package Skybrud.Essentials.Http --version 1.2.2
or the NuGet package manager:
Install-Package Skybrud.Essentials.Http -Version 1.2.2
Changelog
- Updated the
Skybrud.Essentialsdependency (see d52f90b)
This doesn't affect the package directly, but since we have other packages with a direct dependency forSkybrud.Essentials.Http, but usingSkybrud.Essentialsas a transitive dependency, we might as well bump the dependency to the newest version.
v1.2.1
Installation
Install via NuGet - either via the .NET CLI:
dotnet add package Skybrud.Essentials.Http --version 1.2.1
or the NuGet package manager:
Install-Package Skybrud.Essentials.Http -Version 1.2.1
Changelog
- Updated the
Skybrud.Essentialsdependency (see 42f42f6)
This doesn't affect the package directly, but since we have other packages with a direct dependency forSkybrud.Essentials.Http, but usingSkybrud.Essentialsas a transitive dependency, we might as well bump the dependency to the newest version.
v1.2.0
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
HttpExceptionclass (see ad19505)
TheHttpExceptionclass already had a constructor taking an instance ofIHttpResponse, but didn't allow specifying a custom exception message. The new constructor overload also take anIHttpResponsevia 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 likeDoHttpGetRequestandDoHttpPostRequest, 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
HttpClientclass (see 7262fb5)
TheHttpClientclass have non-async methods likeGet,Postand 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 theHttpClientclass has similarGetAsync,PostAsyncand similar methods. -
More
HttpClientparameters 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.
v1.1.5
Installation
Install via NuGet - either via the .NET CLI:
dotnet add package Skybrud.Essentials.Http --version 1.1.5
or the NuGet package manager:
Install-Package Skybrud.Essentials.Http -Version 1.1.5
Changelog
-
Fixed issues with query string not being passed on to underlying code (see ea53ed6)
-
Added support for
NameValueCollectionparameters for more target frameworks (see 967dc7d)
Until now method overloads taking aNameValueCollectionparameter have only been available for the builds targeting .NET Framework, but as .NET Standard 2.0+ and .NET 5+ also supportNameValueCollection, the same method overloads should be available for these target frameworks as well. -
Updated the
Skybrud.Essentialsdependency (see 84c77a8)
v1.1.4
Installation
Install via NuGet - either via the .NET CLI:
dotnet add package Skybrud.Essentials.Http --version 1.1.4
or the NuGet package manager:
Install-Package Skybrud.Essentials.Http -Version 1.1.4
Changelog
- Updated the Skybrud.Essentials dependency (see e0f7591)
With this release,Skybrud.Essentials.Httpnow has a dependency forv1.1.47ofSkybrud.Essentialsinstead ofv1.1.46. The newer version doesn't contain any new logic directly used bySkybrud.Essentials.Http, but by updating the dependency, packages or projects consumingSkybrud.Essentials.Httpdoesn't have to have an explicit dependency forSkybrud.Essentialsin order to use logic in the newest version.
v1.1.3
Installation
Install the NuGet package - either via the .NET CLI:
dotnet add package Skybrud.Essentials.Http --version 1.1.3
or the NuGet package manager:
Install-Package Skybrud.Essentials.Http -Version 1.1.3
Changelog
-
Introduced new
HttpExceptionclass (see 84dadf8)
The new class provides a concrete implementation of the "IHttpException" interface, and may be used to represent various HTTP errors. -
Added various extension methods for working with
IHttpResponse(see af6c7c4)
The extension methods includeThrowIfNotSuccessful, which will trigger an exception if the status code of aIHttpResponseis not either 200 OK or 201 Created. -
Added
ResponseUriproperty to theHttpResponseBaseclass (see b4bcc5d)
TheIHttpResponseinterface already describes aResponseUriproperty, and asHttpResponseBasewraps an instanceIHttpResponse, it might as well expose the underlyingResponseUri.
v1.1.2
Installation
Install the NuGet package - either via the .NET CLI:
dotnet add package Skybrud.Essentials.Http --version 1.1.2
or the NuGet package manager:
Install-Package Skybrud.Essentials.Http -Version 1.1.2
Changelog
-
Updated the Skybrud.Essentials dependency (see e4a61d1)
Updates the dependency to v1.1.46. -
Added extension methods for setting the authorization header of an
IHttpRequest(see d3f4da4)
The package already contains aSetAuthorizationHeaderextension method for setting the raw header value. To help developers in more specific cases, the package now also has theSetAuthorizationBasicandSetAuthorizationBearerextension methods.
v1.1.1
Installation
Install the NuGet package - either via the .NET CLI:
dotnet add package Skybrud.Essentials.Http --version 1.1.1
or the NuGet package manager:
Install-Package Skybrud.Essentials.Http -Version 1.1.1
Changelog
- Enabled support for nullable reference types (see d07bec6)
This includes adding .NET 5 and .NET 6 as additional target frameworks, as they come with extended code analysis functionality out of the box. The Nullable package is added a development dependency to older target frameworks to provide the same code analysis functionality.
v1.1.0
Installation
Install the NuGet package - either via the .NET CLI:
dotnet add package Skybrud.Essentials.Http --version 1.1.0
or the NuGet package manager:
Install-Package Skybrud.Essentials.Http -Version 1.1.0
Breaking changes
🅱️ Added newGetResponseAsyncmethods to theIHttpRequestandHttpRequesttypes (see 792c3aa)
This is a breaking change since the release adds a new method to theIHttpRequestinterface.
Other changes
-
Introduced new
IHttpClientAsyncinterface (see 7e01cfb)
The new interface serves an async counterpart of the existingIHttpClientinterface, which describes methods for making non-async requests.This commit also makes the
HttpClientclass implement the new interface so it can be used for both non-async and async requests. -
Implemented additional
SetBodyextension methods forIHttpRequest(see f7b76ac) -
Added additional constructor overloads to the
HttpRequestclass (see c9d361b) -
Added additional HTTP verb method overloads to the
HttpRequestclass (see 994cf87) -
Added various extension methods for
IHttpClientAsync(see 24edd28 and 87eae0e) -
Added constants for various content types (see fd79309)
-
Marking a lot of code as obsolete (see da53f8f)
In order to get a cleaner implementation, this commits marks a lot of code as obsolete:DoHttp{Verb}Requestmethods should no longer be used. UseGet,Post,Patch,PutandDeletemethods instead- Usage of
IGetOptionsshould be replaced byIHttpRequestOptionsalong with theGetResponsemethod - Usage of
IPostOptionsshould be replaced byIHttpRequestOptionsalong with theGetResponsemethod
v1.0.19
Installation
Install the NuGet package - either via the .NET CLI:
dotnet add package Skybrud.Essentials.Http --version 1.0.19
or the NuGet package manager:
Install-Package Skybrud.Essentials.Http -Version 1.0.19
Changelog
- Improved
HttpRequest.GetResponseexception handling (see #2 and 484dfff)
.NET's exception handling differs slightly for HTTP protocol errors when comparing .NET Framework and .NET Standard, so the .NET Standard version of this package didn't properly detectWebExceptionexceptions as they were hidden behind anAggregateException. With this release,WebExceptionexception are now properly detected from the inner exception of theAggregateException.