Skip to content

ZLink HTTP Client For Kotlin — 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-kotlin is a client that calls HTTP APIs with Kotlin coroutines. It configures the client/request with a zlink-style DSL and fluent builder, and every submit is a true suspend function, so no thread is parked while waiting for a response.

import systems.zlink.httpclient.kotlin.*

suspend fun loadProfile(client: ZLinkHttpClient): PlayerProfile =
    client.get("/players/7281").await<PlayerProfile>().body()

Table Of Contents

Chapter Document Content
1 Overview Design philosophy, deliverable boundary, execution model
2 Getting Started Dependency, first request, DSL builder
3 Client Configuration Builder options, client reuse
4 Making Requests HTTP methods, query, headers, request timeout
5 Request Body JSON, raw, form, multipart, streaming upload
6 Handling Responses Response structure, await/fetch, status handling
7 Coroutines suspend, non-blocking, concurrency, resume dispatcher
8 Streaming awaitDownload 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 formal contract and regression test axes are owned by the spec document kotlin-http-client.ko.md.