Releases: muhammadzkralla/ZHttp
ZHttp JVM
ZHttp JVM
Complete support for the JVM projects like Android, Spring Boot, Console applications, etc.
ZHttp JVM
Removing AAR packaging and replacing it with only JAR packaging.
ZHttp JVM
Merge pull request #43 from muhammadzkralla/jvm fix: Included JAR file in the build.
ZHttp JVM
Remove Android-Specific Code and Dependencies
Overview
This PR focuses on making the library platform-independent by removing all Android-specific code and dependencies. The main changes include replacing Android log statements with System.err.println()
and eliminating any dependencies that were specific to the Android platform.
Changes Made
- Logging:
- Replaced all instances of
android.util.Log
withSystem.err.println()
for error messages andSystem.out.println()
for general logs. This ensures compatibility across different JVM environments.
- Replaced all instances of
- Dependencies:
- Removed all Android-specific dependencies from the
build.gradle
file. This helps in ensuring that the library can be used in non-Android projects without pulling in unnecessary dependencies.
- Removed all Android-specific dependencies from the
- Configuration:
- Updated the
build.gradle
to remove configurations that were specific to Android, ensuring a clean setup for JVM-based projects.
- Updated the
- Unit Tests:
- Ensured all unit tests run successfully without relying on any Android-specific setup. This helps in maintaining the reliability of the library across different platforms.
Impact
These changes make the library more versatile and usable in a wider range of projects, including Kotlin console applications and other JVM-based environments. By removing the Android-specific code and dependencies, the library is now more lightweight and easier to integrate into non-Android projects.
Verification
- Unit Tests: All existing unit tests were run to verify that the library functions correctly without the Android-specific code.
- Manual Testing: Conducted manual tests in a JVM environment to ensure that logging and other functionalities work as expected.
Conclusion
This PR makes the library more adaptable and platform-independent by removing Android-specific code and dependencies. It maintains the core functionalities while broadening the scope of potential use cases.
ZHttp 2.6
Key Features and Improvements:
-
Introduce Retry Mechanism for HTTP Requests
- Implement a configurable retry mechanism to enhance the robustness of HTTP requests.
- Allow users to specify retry count, delay between retries, HTTP status codes, and exceptions that trigger retries.
- Provide better handling of transient network issues, improving the reliability of API interactions.
-
Comprehensive Unit Tests for HTTP Requests
- Add extensive unit tests covering all HTTP request types (GET, POST, DELETE, PUT, PATCH, MULTIPART).
- Test scenarios include various response types:
- Void responses
- String responses
- Deserialized object responses
- List responses
- Map responses
- Complex responses
- Responses with parameters
- Ensure tests validate both successful and error scenarios to guarantee the reliability of the library.
- Simplify and modularize test code to improve maintainability and readability.
-
Enhance Code Readability and Maintainability
- Refactor request handling code to be more modular and easier to understand.
- Improve comments and documentation within the codebase, providing clarity on the new retry mechanism and its benefits.
- Optimize code structure to facilitate future enhancements and maintenance.
-
Ensure Backward Compatibility
- Maintain existing functionality and interfaces to avoid breaking changes for current users of the library.
- Add test cases to verify the integrity and compatibility of the new retry mechanism and unit tests with existing code.
ZHttp
- Implement auto-serialization for multipart request bodies
- Automatically convert request body objects into their appropriate serialized formats, simplifying the process for the user.
- Remove the need for manual serialization, reducing potential errors and boilerplate code.
- Enhance code readability and maintainability
- Refactor multipart request handling code to be more modular and easier to understand.
- Improve comments and documentation within the codebase to provide clarity on the serialization process and its benefits.
- Ensure backward compatibility
- Maintain existing functionality and interfaces to avoid breaking changes for current users of the library.
- Add test cases to verify the integrity and compatibility of the new serialization feature with existing code.
Overall, these optimizations streamline the process of creating multipart requests, making it more user-friendly and robust.
ZHttp
JWT bearer authentication and basic auth implemented per client instance and architecture pattern improved.
ZHttp
Default headers and queries are set to null and JWT authentication injection for each request made with the client.
ZHttp
Consistency In Arguments.