Released 19 July 2019.
request.WithBodynow allowsHttpContentinput.bodyBuilder.FormUrlEncodednow has an overload for dictionary input.- Fixed form-URL-encoded body helper enforcing URL length limits.
Released 27 April 2019.
- Added support for reading responses into
JToken,JObject,JArray, ordynamic. - Added fluent HTTP body builders, and deprecated some older body methods to simplify usage.
- Added
IsSuccessStatusCodeto response. - Fixed default web proxy not being used.
- Updated dependencies.
Released 18 April 2018.
- Added options to finetune behavior (see
client.SetOptionsandrequest.WithOptions). - The base URL now behaves more intuitively in many cases.
Request.WithArgumentsnow omits null argument values by default.Request.WithArgumentsnow also accepts key/value pairs.- Fixed cookie headers not being set.
- Fixed error when passing an object with an indexer property to
WithArguments. - Fixed
WithArgumentschanging the URL incorrectly when it has a #fragment. - Deprecated
client.SetHttpErrorAsExceptionandrequest.WithHttpErrorAsException(useclient.SetOptionsandrequest.WithOptionsinstead). - Compatibility changes:
- Added .NET Framework 4.5 (previously 4.5.2).
- Simplified dependencies in .NET Framework 4.5+ and .NET Standard 2.0+.
Possible impacting changes:
- The base URL is no longer truncated in some cases. For example, a base URL
https://example.org/index.phpwith resourceapinow resolves tohttps://example.org/index.php/apiinstead ofhttps://example.org/api.
Released 19 September 2017.
- Added option to set default behaviour for all requests.
For example, when using an API with URL-based authentication, you can doclient.AddDefault(request => request.WithArgument("token", "..."))to add that argument to all later requests. - Added support for retrying timed-out requests.
- Deprecated
BsonFormatter.
This uses Json.NET'sBsonReader, which is now deprecated. The format isn't used often enough to justify adding a new dependency. If you use it, you can switch to another BSON media type formatter or copy it from the FluentHttpClient code before it's removed. - Fixed error when retrying a request with
POSTcontent. - Fixed
IRetryConfig.MaxRetriescounting the initial request as a retry.
For example,maxRetries: 1never retried. This value now sets the maximum number of retries after the initial request.
Released 08 February 2017.
- New features:
- Added built-in retry support.
- Added methods to set authentication headers (with wrappers for basic auth and OAuth bearer tokens).
- Added support for cancellation tokens.
- Added support for disabling HTTP-errors-as-exceptions per-request or per-client.
- Added support for fault tolerance using
IRequestCoordinator. - Added support for
IWebProxy. - Added
client.PatchAsync. - Added
client.SetUserAgentto override defaultUser-Agentheader.
- Breaking changes:
- Replaced
response.AsList<T>withreponse.AsArray<T>. - Removed
JsonNetFormatter(deprecated since 2.1, now built-in). - Revamped
IResponseto make it easier to read response data. - Simplified
IClientandIRequestby moving some methods into extension methods. - Simplified
IHttpFilterby removing the message arguments (already accessible viaIRequestandIResponse).
- Replaced
- Improvements:
- Fixed the underlying
HttpClientbeing disposed when it isn't owned by the fluent client. - Fixed
client.Filtersnot added to the interface. - Fixed
client.Filters.Remove<T>()only removing the first match. - Fixed unintuitive behaviour when the base URL doesn't end in a slash.
- Fixed the underlying
- Relicensed from CC-BY 3.0 to more permissive MIT license.
Released 12 December 2016.
- Migrated to .NET Standard 1.3 + .NET Core to improve crossplatform support.
Released 30 June 2016.
- Updated to latest version of Json.NET.
- Merged formatters library into client.
- Prepared for migration to .NET Core.
Released 08 May 2016.
- Migrated to PCL for cross-platform compatibility.
- Removed support for JSONP.
(This isn't needed since a JSONP API most likely supports JSON, and removing it eliminates a dependency on non-PCL code.) - Deprecated
JsonNetFormatter.
(The underlying HttpClient now uses Json.NET by default.)
Released 28 April 2016.
- Replace
IFactorywith a new extensibility model usingIHttpFilter.
(This enables simpler and more powerful extensibility without exposing implementation details. For example, error handling can now read the underlying HTTP response directly without temporarily changing theRaiseErrorsflag.) - Removed request cloning (no longer needed).
- Updated to the latest version of HttpClient and Json.NET.
Released 28 October 2015.
- The client is now
IDisposable.
Released 30 October 2013.
- Updated to latest versions of HttpClient and Json.NET.
Released 28 August 2013.
- Added request cloning to support use cases like batch queries.
- Added UTF-8 as a supported encoding by default.
Released 23 May 2012.
- Initial client release:
- Wrapped HttpClient with a fluent interface.
- Added user-agent and accept headers by default.
- Added
ApiExceptionthrown when server returns a non-success error code. - Added
request.WithArgumentto format URL arguments from an anonymous object or key + value. - Added
response.As<T>(),.AsList<T>(),.AsByteArray(),AsString(), andAsStream()to parse the response body. - Added
response.Wait()to simplify synchronous use. - Added support for customising the message handler.
- Added
IFactoryfor extensibility.
- Initial formatters release:
- Added base
MediaTypeFormatterclass to simplify implementations. - Added
MediaTypeFormatterimplementations for BSON, JSON, and JSONP using Json.NET. - Added
MediaTypeFormatterfor plaintext (serialisation only).
- Added base
- Added unit tests.