Skip to content

Releases: scottoffen/fluenthttpclient

4.2.3

21 Jun 05:00
635dde3
Compare
Choose a tag to compare

Fixes issue where an unnecessary question mark (?) was being added to the end of the url if there were no query parameters.

4.2.2

21 Jun 01:38
b4ed479
Compare
Choose a tag to compare

Update Default Version

The default Version on the HttpRequestMessage has been updated from 1.0 to 2.0.

Query Parameters

Updates how query parameters are added and stored in order to allow for multiple values for the same key. Previously, if a key was added twice, only the second value ended up in the query parameters.

Disable Chunked Transfer Encoding

When using the extension method WithJsonContent(), the Content-Length header gets set to -1. In most cases, this is not an issue. In most cases, this is the desired and correct behavior. Occasionally it is not. See this issue for more information.

In those rare cases where this causes issues with the server you are communicating with, this behavior can now be disabled using the new DisableChunkedTransferEncoding() extension method.

4.2.1

01 Jun 04:42
0fdba62
Compare
Choose a tag to compare
  • Adds extensions for sending XML content

4.0.0

31 Mar 02:00
feabb32
Compare
Choose a tag to compare
  • Adds and publishes summary documentation
  • Refactored builder to create new HttpRequestMessage on every send operation.
  • Removes OnHttpRequestException handler. Use Polly instead.
  • More expansive extension methods! Much wow!

3.0.5

01 Mar 00:30
afce371
Compare
Choose a tag to compare

What's Changed

  • Renamed the static class for global options to FluentHttpClientOptions by @scottoffen in #19

Full Changelog: 3.0.4...3.0.5

3.0.4

15 Feb 00:43
d326b57
Compare
Choose a tag to compare
  • Enables nullable in the csproj
  • Adds an extension methods for .WithQueryParam that takes nullable objects. If the object is null, an empty string is added. If the object is not null, adds the result of ToString()
  • Adds an extension method HttpClient.WithoutRoute(), set's the route to an empty string

3.0.3

10 Jan 19:13
fbc81b6
Compare
Choose a tag to compare

Fix breaking issue with query parameters not being sent with request. (#14)

3.0.2

10 Jan 04:35
Compare
Choose a tag to compare

Adds target for .Net 8.0

This version now targets .Net 6.0, .Net 7.0 and .Net 8.0

#8 Trailing Slashes Should Not Be Added When Route Is Empty

Fixes issue where trailing slash was being added if no value was provided for Route.
To intentionally include a trailing slash, use a slash for the route instead of leaving it blank.

client.UsingRoute(); // no trailing slash
client.UsingRoute("/"); // includes trailing slash

#7 Add HttpRequestException Handler

You can now fluently add an exception handler for HttpRequestException. When not used, the exception will be thrown without any behavior change. When used, the handler is called and a NullHttpResponseMessage object is returned with a StatusCode of 0. The handler must be added before the request is sent.

var response = await _client
    .UsingRoute("/user/list")
    .WithQueryParam("sort", "desc")
    .OnHttpRequestException(ex => { /* exception handling code here */ })
    .GetAsync()
    .OnFailure(msg => { success = false; })
    .OnSuccess(msg => { success = true; });

This will only handle exceptions of type HttpRequestException. All other exception will be unhandled.

An extension method HttpRequestExceptionOccurred on HttpResponseMessage will return true if the object is the subclass NullHttpResponseMessage. You do not need to check this in the OnSuccess nor OnFailure handlers, as neither OnSuccess nor OnFailure handlers will be called when the exception hander is used and an exception is throw, as both of those methods are specific to the response from the external service.

2.1.0

01 Dec 23:39
0ac0b3e
Compare
Choose a tag to compare
  • Drops .NetStandard 2.0 target framework
  • Adds .NET 7.0 target framework
  • Adds support for XML deserialization
  • Changes default value of suppressException to true

1.4.0

13 May 16:51
f4a9d0f
Compare
Choose a tag to compare
Merge pull request #1 from scottoffen/add-json-extensions

Improve JSON support