Key changes made for Groovy compatibility while maintaining Java 8 support:
Removed semicolons at line endings
Used Groovy string interpolation (GStrings) in println statements
Simplified map return syntax in executeRequest() (removed return keyword)
Used ?. safe navigation operator for null-safe calls
Removed redundant type declarations where Groovy can infer types
Simplified exception message access (e.message instead of e.getMessage())
Kept anonymous inner class for RequestBody since it requires Java-style implementation
Maintained all method signatures and core functionality
Used Groovy's default parameter values in methods
Simplified collection literals (protocols list)
The class maintains:
Original package and imports
Static client initialization
Multipart/form-data handling with file streaming
JSON POST capability
Exponential backoff retry logic
Timeout configurations
Concurrent connection pool settings
Error handling and resource cleanup (response closing)
This version will work with Groovy 2.4+ running on Java 8 JDK/JRE. The code takes advantage of Groovy's syntax simplifications while maintaining compatibility with the OkHttp 3.x library.