Skip to content

Releases: kampute/http-client

2.3.1

27 Jul 08:36
796081a
Compare
Choose a tag to compare

This release brings crucial security improvements, minor fixes, and upgrades:

  • Increased the minimum version of the System.Text.Json package 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

11 May 15:50
ee8f935
Compare
Choose a tag to compare

This release introduces a new feature, several enhancements, and improves clarity in method naming:

  • Added the HttpRequestScope class, which allows for scoped modifications of properties and headers for HTTP requests sent using the HttpRestClient. This feature enables developers to configure and reuse scopes across different parts of the application, improving modularity and reducing redundancy.
  • Introduced the WithScope extension method for the HttpRestClient class, 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 With prefix 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

08 May 08:22
d6af688
Compare
Choose a tag to compare

This release includes a bug fix and several minor optimizations:

  • Resolved an ArgumentNullException in the FlyweightCache class's default constructor that could occur under certain conditions.
  • Added the HasActiveScope property to the ScopedCollection class, allowing for straightforward detection of active scopes.
  • Eliminated lazy initialization of property and header scopes in the HttpRestClient class to reduce unnecessary overhead.

Thank you for your attention to this release!

2.2.0

07 May 09:38
f429ecc
Compare
Choose a tag to compare

This release introduces improved flexibility for managing headers and properties within scopes:

  • The BeginHeaderScope method 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 to null.
  • Similarly, the BeginPropertyScope method facilitates the removal of request properties by setting the property value to null.

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

06 May 10:25
f4fec3d
Compare
Choose a tag to compare

In this release, we have addressed a bug.

  • Corrected the definition of delegate used in the HttpError401Handler class, changing type of its context parameter from HttpRequestErrorContext to HttpResponseErrorContext.

Thank you for your attention to this update!

2.1.0

06 May 07:53
b552dc7
Compare
Choose a tag to compare

In this release, we focused on refining content deserialization handling and enhancing documentation clarity. Check out what’s new:

  • Introduced lazy caching in the HttpContentDeserializerCollection class 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.Json library in the Kampute.HttpClient.Json package 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

05 May 07:42
9cdd999
Compare
Choose a tag to compare

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 HttpRestClient class, 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, and SharedHttpClient to 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 HttpRestClient class now utilizes a shared HttpClient with default configuration. This change simplifies setup but alters behavior related to compressed responses. Customization of this behavior is now possible through the SharedHttpClient.Factory delegate.
  • If the default request headers of the HttpRestClient include an Accept header, the library will not dynamically evaluate the Accept header 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 SendAsync method of HttpRestClient now returns an HttpResponseMessage rather than just HttpResponseHeaders, providing greater flexibility in response processing.
  • Removed the FetchToStream extension 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 to AsyncUpdateThrottle<T> to better reflect its functionality, with LastUpdateUnixTime now called LastUpdatedTime, returning a DateTimeOffset instead of Unix time.
  • The Acquire method in SharedDisposable<T> has been renamed to AcquireReference, changing its return type to a disposable object enclosing the shared instance, thus removing the need for a Release method.
  • The IRetrySchedulerFactory has been renamed to IBackoffStrategy, and the corresponding extension method from IRetryStrategy is now ToBackoffStrategy.
  • Simplified the delegate parameters for HttpError401Handler to include only the HttpResponseErrorContext and a cancellation token.
  • The GetAcceptableMediaTypes method in HttpContentDeserializerCollection now returns an enumerable of media types as strings, instead of a read-only collection of MediaTypeWithQualityHeaderValue objects.
  • 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!

1.6.0

14 Apr 14:35
fdbc382
Compare
Choose a tag to compare

In this update, we continue our mission to improve the developer experience, optimize resource management, and ensure the flexibility and reliability of the library. Here is what's new:

  • Introduced the GzipCompressedContent and DeflateCompressedContent classes to provide built-in support for Gzip and Deflate compression methods. These classes simplify the process of applying compression to HttpContent, aiming to enhance network efficiency and performance.
  • Added AsGzip and AsDeflate extension methods for HttpContent that allow developers to easily compress data before sending it over the network. This update extends our library's functionality, offering more flexibility in handling HTTP requests and responses.
  • Enhanced the IsReusable extension method for HttpContent to more accurately determine if an instance can be reused. This improvement is crucial for scenarios where a failed request might need to be retried, ensuring that HTTP content can be sent again without needing to recreate it from scratch.
  • Updated various XML comments throughout the code to enhance documentation clarity and reflect the introduction of new compression features. This ensures that developers can fully leverage new functionalities with a clear understanding of their implementation and benefits.

These updates reflect our ongoing commitment to our developer community. Your feedback is crucial in guiding our developments and enhancements. We appreciate your continued support and collaboration.

1.5.0

02 Apr 12:50
e20605f
Compare
Choose a tag to compare

In this update, we continue our mission to improve the developer experience, optimize resource management, and ensure the flexibility and reliability of the library. Here is what's new in the latest release:

  • Introduced the DownloadAsync method to the HttpRestClient class. This method offers an enhancement over the existing FetchToStreamAsync by allowing the caller to decide how to create the download target stream based on the received content headers, providing greater flexibility and control over the download process.
  • Relocated the FetchToStreamAsync method from the HttpRestClient class, transforming it into an extension method. This change improves the modularity and reusability of our codebase, aligning with modern development practices.
  • Updated various XML comments throughout the code to reflect these changes and to enhance documentation clarity.

These updates reflect our ongoing commitment to our developer community. Your feedback is crucial in guiding our developments and enhancements. We appreciate your continued support and collaboration.

1.4.1

20 Mar 14:11
5e0bc96
Compare
Choose a tag to compare

In this update, we've tackled an issue where responses lacking a body but with a specified return type would lead to the client returning the default value for that type, which could cause unexpected behavior. To enhance clarity and predictability in error handling, we have revised the implementation to throw an HttpContentException under these circumstances. This modification ensures developers are promptly informed about missing response bodies, thereby avoiding the unintentional use of default values.

We appreciate your ongoing support and engagement.