Releases: kampute/http-client
2.5.0
This release focuses on improved HTTP resiliency and platform updates.
Enhancements
- Introduced a unified retry mechanism for transient HTTP errors via the new
RetryableHttpErrorHandlerabstract base class. - Added the
TransientHttpErrorHandlerclass, enabling a single handler to manage retries across multiple HTTP status codes.
Platform & Dependency Updates
- Added support for .NET 10.0.
- Updated JSON dependencies to newer major versions with automatic minor and patch updates.
2.4.0
This release updates key JSON serialization dependencies to ensure improved compatibility and performance across the Kampute.HttpClient packages.
Key Updates
- System.Text.Json upgraded from 8.0.6 → 10.0.0 in Kampute.HttpClient.Json.
- Newtonsoft.Json upgraded from 13.0.3 → 13.0.4 in Kampute.HttpClient.NewtonsoftJson.
2.3.2
This maintenance release focuses on improving documentation, updating dependencies, and optimizing the build process.
Code Refactoring
- Refactored the default constructor of the
SharedDisposable<T>class to use constructor delegation.
Documentation Improvements
- Migrated documentation generation workflow from DocFX to Kampose for a more modern and maintainable setup, with automated documentation completeness auditing.
- Added
NamespaceDocclasses to provide namespace-level documentation. - Added missing
<value>and<returns>tags in XML comments. - Fixed various XML documentation formatting and consistency issues.
Dependency Updates
- Updated
System.Text.Json packagereference to version 8.0.6. - Updated test project dependencies to their latest stable versions.
Build and Project Changes
- Disabled package generation on build for all projects.
- Updated the README file with the latest information and usage details.
2.3.1
This release brings crucial security improvements, minor fixes, and upgrades:
- Increased the minimum version of the
System.Text.Jsonpackage due to a severe vulnerability in the previous version. - Fixed various typos in the documentation to improve readability and understanding.
- Upgraded the .NET version of the test projects to 8.0 due to the end of life of the previously used version, 6.0, ensuring continued support and access to the latest features.
Thank you for your continued support and feedback!
2.3.0
This release introduces a new feature, several enhancements, and improves clarity in method naming:
- Added the
HttpRequestScopeclass, which allows for scoped modifications of properties and headers for HTTP requests sent using theHttpRestClient. This feature enables developers to configure and reuse scopes across different parts of the application, improving modularity and reducing redundancy. - Introduced the
WithScopeextension method for theHttpRestClientclass, making it straightforward to create and manage these scopes. This method ensures that all modifications are temporary and only apply to the requests made within the scope. - Improved error messages in case of response deserialization failures to enhance clarity and provide more detailed information.
- Added
Withprefix to extension methods modifying retry strategies, ensuring consistency and clarity in the API's method naming conventions.
Thank you for your continued support and feedback!
2.2.1
This release includes a bug fix and several minor optimizations:
- Resolved an
ArgumentNullExceptionin theFlyweightCacheclass's default constructor that could occur under certain conditions. - Added the
HasActiveScopeproperty to theScopedCollectionclass, allowing for straightforward detection of active scopes. - Eliminated lazy initialization of property and header scopes in the
HttpRestClientclass to reduce unnecessary overhead.
Thank you for your attention to this release!
2.2.0
This release introduces improved flexibility for managing headers and properties within scopes:
- The
BeginHeaderScopemethod now allows for the removal of headers. To remove a header during the scope's lifetime, in the collection of scoped headers, simply set its value tonull. - Similarly, the
BeginPropertyScopemethod facilitates the removal of request properties by setting the property value tonull.
These changes ensure more dynamic control over HTTP headers and properties, simplifying customization per request.
Thank you for your attention to this update!
2.1.1
In this release, we have addressed a bug.
- Corrected the definition of delegate used in the
HttpError401Handlerclass, changing type of itscontextparameter fromHttpRequestErrorContexttoHttpResponseErrorContext.
Thank you for your attention to this update!
2.1.0
In this release, we focused on refining content deserialization handling and enhancing documentation clarity. Check out what’s new:
- Introduced lazy caching in the
HttpContentDeserializerCollectionclass to optimize performance and resource utilization. - Modified the FlyweightCache class by replacing its indexer with a method because, unlike an indexer, a method can be used as a delegate.
- Updated the minimum required version of the
System.Text.Jsonlibrary in theKampute.HttpClient.Jsonpackage from 8.0.2 to 8.0.3, to ensure utilization of a bug-free library. - Enhanced various parts of our documentation to provide clearer and more detailed information.
Thank you for your ongoing support and look forward to your feedback on these enhancements!
2.0.0
In this update, we are excited to announce significant enhancements designed to boost performance, optimize resource utilization, and increase the flexibility of our library. Here is what's new:
- Enhanced performance and reduced memory usage across the library, ensuring more efficient operation.
- Improved the maintainability, reusability, and extensibility of the codebase, paving the way for easier future enhancements.
- Introduced the ability to define headers and properties scoped specifically to individual request blocks, enhancing customization and control.
- Added new extension methods to the
HttpRestClientclass, enabling responses to be obtained as an array of bytes, a string, a stream, or saved directly into a stream. - Introduced
EmptyContent, representing HTTP content with no data, ideal for specific request scenarios. - Launched new utility classes including
ScopedCollection,FlyweightCache, andSharedHttpClientto support advanced resource management and sharing strategies. - Improved the interface of the
SharedDisposable<T>class, enhancing its usability in resource management contexts.
This release includes a major code rewrite, which brings some breaking changes detailed below:
- The default constructor of the
HttpRestClientclass now utilizes a sharedHttpClientwith default configuration. This change simplifies setup but alters behavior related to compressed responses. Customization of this behavior is now possible through theSharedHttpClient.Factorydelegate. - If the default request headers of the
HttpRestClientinclude anAcceptheader, the library will not dynamically evaluate theAcceptheader based on the configured response deserializers and expected response object type. This change reduces unnecessary resource consumption when the expected response media types are predetermined by the caller. - The non-generic
SendAsyncmethod ofHttpRestClientnow returns anHttpResponseMessagerather than justHttpResponseHeaders, providing greater flexibility in response processing. - Removed the
FetchToStreamextension method in favor of specific methods tailored to fetch responses as bytes, strings, streams, or to save directly into a stream. - Renamed the
AsyncGuard<T>class toAsyncUpdateThrottle<T>to better reflect its functionality, withLastUpdateUnixTimenow calledLastUpdatedTime, returning aDateTimeOffsetinstead of Unix time. - The
Acquiremethod inSharedDisposable<T>has been renamed toAcquireReference, changing its return type to a disposable object enclosing the shared instance, thus removing the need for aReleasemethod. - The
IRetrySchedulerFactoryhas been renamed toIBackoffStrategy, and the corresponding extension method fromIRetryStrategyis nowToBackoffStrategy. - Simplified the delegate parameters for
HttpError401Handlerto include only theHttpResponseErrorContextand a cancellation token. - The
GetAcceptableMediaTypesmethod inHttpContentDeserializerCollectionnow returns an enumerable of media types as strings, instead of a read-only collection ofMediaTypeWithQualityHeaderValueobjects. - Removed unused dictionary extension methods to streamline the codebase.
We appreciate your feedback and support, which are vital in guiding our continuous development and enhancement efforts.
Thank you!