Module dmx.fun.http
module dmx.fun.http
java.net.http.HttpClient wrapper for dmx-fun.
Wraps the JDK's built-in HTTP client so that both network failures and
HTTP error status codes are surfaced as a single typed Result
rather than a mix of exceptions and status-code checks:
DmxHttpClient client = DmxHttpClient.of(HttpClient.newHttpClient());
Result<String, HttpError> result =
client.send(request, BodyHandlers.ofString());
result
.peek(body -> System.out.println("OK: " + body))
.peekError(err -> System.err.println("Failed: " + err));
Error categories — HttpError:
HttpError.ClientError— 4xx responsesHttpError.ServerError— 5xx responsesHttpError.Timeout—HttpTimeoutExceptionHttpError.NetworkFailure—IOException/InterruptedException
-
Packages
ExportsIndirect Exports -
Modules
Requires