Skip to content
This repository was archived by the owner on Sep 23, 2025. It is now read-only.

4.0.0

Choose a tag to compare

@bradleyhodges bradleyhodges released this 22 Aug 11:00
· 29 commits to main since this release

This release introduces several significant updates and enhancements to the APIManager package, particularly within the HTTP class. These changes include new features, improved performance, and updates to the documentation.

Major Features & Updates:

  • New HTTP Class Implementation:

    • The HTTP class has been fully revamped with additional support for advanced features like browser impersonation, DNS caching, RFC 8305-compliant Happy Eyeballs, HTTP version fallback, and more.
    • Direct HTTP method utilities for GET, POST, PUT, PATCH, and DELETE requests have been implemented for ease of use.
  • Browser Impersonation:

    • Added a new method impersonateBrowser() which allows for sending HTTP requests with headers and behavior that mimic a web browser, including cookies, sessions, redirects, and other browser-like behavior.
  • Happy Eyeballs (RFC 8305-compliant):

    • The HTTP client now supports Happy Eyeballs, which attempts to connect to both IPv4 and IPv6 addresses simultaneously, selecting the faster option. This feature is enabled by default.
  • Feature Flags:

    • A new set of feature flags has been introduced, allowing users to toggle various features like DNS caching, HTTP version fallback, retry mechanisms, and more. The following flags are available:
      • useHappyEyeballs() (enabled by default)
      • useRetry() (disabled by default)
      • useDnsCache() (disabled by default)
      • useHttpVersionFallback() (enabled by default)
      • useMinTlsVersion() (enabled by default)
      • useCloudflareDns() (disabled by default)
      • useCookieJar() (enabled by default)
      • useDefaultConfig() (enabled by default)
      • useEvaluateRequestIntention() (enabled by default)
  • Improved DNS Caching:

    • DNS caching has been improved, allowing for faster resolution of DNS queries in high-traffic scenarios. This feature can be enabled or disabled via the useDnsCache() flag.
  • RFC-Compliant HTTP Client:

    • The HTTP client has been updated to fully comply with RFC 8305, which improves connection reliability and reduces latency by resolving both IPv4 and IPv6 addresses efficiently.

Other Enhancements:

  • Performance Improvements:

    • Various optimizations were made to reduce overhead and improve performance, particularly in high-throughput scenarios.
  • Error Handling & Logging:

    • The RuntimeException behavior has been fixed to provide more accurate error reporting and contextual logging.
  • Linter Recommendations:

    • Multiple rounds of linter recommendations were applied to improve code quality and maintainability.

Documentation:

  • README Updates:

    • The README has been updated to reflect the new HTTP class and its features. Instructions for using the new methods and feature flags are now included.
  • Method Overview:

    • A detailed method overview for the HTTP class has been added, along with a new "Feature Flags" section to clearly indicate which features are enabled by default and how to customize them.

Bug Fixes:

  • Fix Incorrect RuntimeException Behavior:
    • Corrected improper handling of RuntimeException during certain HTTP request scenarios.

Contributors:

We recommend updating to this version to take advantage of the new features and improvements. As always, feedback and contributions are welcome!