Skip to content

Releases: skybrud/Skybrud.Essentials.Http

v1.2.0

27 Jan 19:37
Compare
Choose a tag to compare

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)
    The HttpException class already had a constructor taking an instance of IHttpResponse, but didn't allow specifying a custom exception message. The new constructor overload also take an IHttpResponse 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 like DoHttpGetRequest and DoHttpPostRequest, 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)
    The HttpClient class have non-async methods like Get, 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 the HttpClient class has similar GetAsync, 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.

v1.1.5

27 Jan 19:25
Compare
Choose a tag to compare

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 NameValueCollection parameters for more target frameworks (see 967dc7d)
    Until now method overloads taking a NameValueCollection parameter have only been available for the builds targeting .NET Framework, but as .NET Standard 2.0+ and .NET 5+ also support NameValueCollection, the same method overloads should be available for these target frameworks as well.

  • Updated the Skybrud.Essentials dependency (see 84c77a8)

v1.1.4

12 Feb 17:56
Compare
Choose a tag to compare

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.Http now has a dependency for v1.1.47 of Skybrud.Essentials instead of v1.1.46. The newer version doesn't contain any new logic directly used by Skybrud.Essentials.Http, but by updating the dependency, packages or projects consuming Skybrud.Essentials.Http doesn't have to have an explicit dependency for Skybrud.Essentials in order to use logic in the newest version.

v1.1.3

05 Feb 15:18
Compare
Choose a tag to compare

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 HttpException class (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 include ThrowIfNotSuccessful, which will trigger an exception if the status code of a IHttpResponseis not either 200 OK or 201 Created.

  • Added ResponseUri property to the HttpResponseBase class (see b4bcc5d)
    The IHttpResponse interface already describes a ResponseUri property, and as HttpResponseBase wraps an instance IHttpResponse, it might as well expose the underlying ResponseUri.

v1.1.2

23 Jan 20:48
Compare
Choose a tag to compare

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 a SetAuthorizationHeader extension method for setting the raw header value. To help developers in more specific cases, the package now also has the SetAuthorizationBasic and SetAuthorizationBearer extension methods.

v1.1.1

01 Nov 15:12
Compare
Choose a tag to compare

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

09 May 10:42
Compare
Choose a tag to compare

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 new GetResponseAsync methods to the IHttpRequest and HttpRequest types (see 792c3aa)
    This is a breaking change since the release adds a new method to the IHttpRequest interface.

Other changes

  • Introduced new IHttpClientAsync interface (see 7e01cfb)
    The new interface serves an async counterpart of the existing IHttpClient interface, which describes methods for making non-async requests.

    This commit also makes the HttpClient class implement the new interface so it can be used for both non-async and async requests.

  • Implemented additional SetBody extension methods for IHttpRequest (see f7b76ac)

  • Added additional constructor overloads to the HttpRequest class (see c9d361b)

  • Added additional HTTP verb method overloads to the HttpRequest class (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}Request methods should no longer be used. Use Get, Post, Patch, Put and Delete methods instead
    • Usage of IGetOptions should be replaced by IHttpRequestOptions along with the GetResponse method
    • Usage of IPostOptions should be replaced by IHttpRequestOptions along with the GetResponse method

v1.0.19

27 Mar 15:10
Compare
Choose a tag to compare

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.GetResponse exception 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 detect WebException exceptions as they were hidden behind an AggregateException. With this release, WebException exception are now properly detected from the inner exception of the AggregateException.

v1.0.18

25 Mar 16:30
Compare
Choose a tag to compare

Installation

Changelog

v1.0.17

24 Mar 21:57
Compare
Choose a tag to compare

Installation

Changelog

  • Introduced new TryGet{Type} extension methods for IHttpQueryString (see #1 and 5d28f87)
    This release introduces a number of extension methods IHttpQueryString for attempting to get values in different types - eg. TryGetBoolean, TryGetInt32and similar.

  • Added null checks to the HttpQueryString.Add and HttpQueryString.Set methods (see c9fc87f)
    The methods now properly handle when being passed a null value.

  • Added Parse methods to the HttpQueryString class, obsoleting the existing ParseQueryString methods (see fc3b31d)
    Having QueryString in the method names feels a bit redundant, so the two ParseQueryString methods have now been marked as obsolete, and two Parse methods have been added to replace them.

  • Added TryParse methods to the HttpQueryString class (see 924dbdb)
    As the Parse methods may fail if passed an invalid string representation of a query string, so the two TryParse methods in this release encapsulates any error handling should the parsing fail.