Skip to content

ZLink HTTP Client For Java — User Guide

⚠️ This guide is not current. The only guide that has finished review and upkeep right now is the .NET guide. This document reflects an earlier state, and once the .NET guide is finished, this document will be deleted and rewritten based on it.

When confirming the contract, don't trust this document — check the spec tree.

zlink-http-client is a general-purpose HTTP client for sending HTTP requests from Java. It is used with a zlink-style fluent builder, and the public surface does not expose java.net.http types.

HttpResponse<CreateGameRes> game = ZLinkHttpClient.create("https://game-api.example.internal")
    .post("/games")
    .body(new CreateGameReq("ranked-match-0611"))
    .submit(CreateGameRes.class)
    .toCompletableFuture().join();   // Compose with thenCompose instead of join inside a handler

Table Of Contents

Chapter Document Content
1 Overview Design philosophy, deliverable boundary, execution model
2 Getting Started Dependency, first request, one-line request
3 Client Configuration Builder options, client reuse, java.net.http mapping
4 Making Requests HTTP methods, query, headers, request timeout
5 Request Body JSON, raw, form, multipart, streaming upload
6 Handling Responses Response structure, submit/fetch, status handling
7 Async CompletionStage, non-blocking, blocking rules
8 Streaming download(sink) download, chunked upload
9 Authentication And TLS Basic/Bearer, HTTPS verification, mTLS
10 Redirect · Retry · Cookie Redirect semantics, retries, cookie jar
11 Proxy HTTP proxy, proxy authentication
12 Compression Transparent gzip/deflate decoding
13 Error Handling Exception model, retriable, exception paths

The Kotlin coroutine (suspend) extension and DSL are covered in the Kotlin Coroutine Extension (a thin idiom layer sharing the Java runtime).

The formal contract and regression test axes are owned by the spec document java-http-client.ko.md.