unirest-java-4
Installation
SKILL.md
Unirest-Java 4.x Reference (v4.10.0)
This skill covers the Unirest-Java 4.x HTTP client library for Java 11+. It uses the built-in java.net.http.HttpClient (replacing Apache HttpClient in 3.x) and defaults to HTTP/2.
Capability Boundaries
✅ Strong Suits
- Building HTTP requests (GET, POST, PUT, DELETE, PATCH) with fluent API
- JSON/object mapping with GSON or Jackson (must declare module explicitly)
- Async requests with CompletableFuture (built into java.net.http.HttpClient)
- File uploads with progress monitoring
- Server-Sent Events (SSE) consumption via
Unirest.sse(url) - WebSocket connections via
Unirest.webSocket(url) - Mock testing for HTTP clients
- Response caching with configurable eviction
- Proxy configuration (simple, system, ProxySelector)
- HTTP/2 by default (configurable via
config.version()) - Custom executor support via
config.executor() - Java Authenticator support via
config.authenticator()