Skip to content
Bluetape4k docs1.11

HTTP Client Foundations

Latest stable Based on Bluetape4k release 1.11.0

bluetape4k-http integrates multiple HTTP client libraries through Kotlin extension functions and DSLs. This manual connects that purpose to the current build, source entry points, tests, configuration resources, and lifecycle evidence instead of duplicating the README feature list.

Use bluetape4k-http when the application needs encoding boundaries, resource ownership, streaming, compatibility, and malformed input. Start with the source entry points below and confirm that their ownership and failure contracts match the calling component. Prefer a smaller standard-library or already-adopted module when it satisfies the same contract without another runtime boundary.

dependencies {
implementation(platform("io.github.bluetape4k:bluetape4k-dependencies:<version>"))
implementation("io.github.bluetape4k:bluetape4k-http")
}

Gradle project path: :bluetape4k-http. Source directory: io/http.

The first source-level concepts to inspect are AsyncClientConnectionManager, CloseableHttpAsyncClientCoroutines, HttpAsyncClient, HttpAsyncClientCoroutines, MinimalHttpAsyncClient, ConfigurableHttpRequest, SimpleHttpRequest, and SimpleHttpResponse. File names are navigation anchors; read each declaration and its tests before treating it as a public contract.

Add the coordinate above, refresh Gradle, and start from the smallest entry point that owns the required task. Open AsyncClientConnectionManager first; it is a concrete source entry point for the module.

Entry pointWhat to verify
AsyncClientConnectionManagerInspect this declaration’s constructors, functions, and ownership contract.
CloseableHttpAsyncClientCoroutinesInspect this declaration’s constructors, functions, and ownership contract.
HttpAsyncClientInspect this declaration’s constructors, functions, and ownership contract.
HttpAsyncClientCoroutinesInspect this declaration’s constructors, functions, and ownership contract.
MinimalHttpAsyncClientInspect this declaration’s constructors, functions, and ownership contract.
ConfigurableHttpRequestInspect this declaration’s constructors, functions, and ownership contract.
SimpleHttpRequestInspect this declaration’s constructors, functions, and ownership contract.
SimpleHttpResponseInspect this declaration’s constructors, functions, and ownership contract.
SimpleRequestProducerInspect this declaration’s constructors, functions, and ownership contract.
SimpleResponseConsumerInspect this declaration’s constructors, functions, and ownership contract.

The README evidence is organized around Overview, Architecture, Overall Architecture: Multi-Backend HTTP Client, HTTP Client Hierarchy (HC5), OkHttp3 Client Hierarchy, Async HTTP Request Flow (HC5 Async + Coroutines), Key Features, 1. Apache HttpComponents 5 (HC5), 2. OkHttp3, and 3. Vert.x HttpClient. Use those topics as a navigation map, then confirm behavior in source and tests. Keep adoption narrow and connect owned resources to the caller lifecycle.

The current build declares these integration edges:

api(project(":bluetape4k-io"))
api(project(":bluetape4k-netty"))
api(project(":bluetape4k-resilience4j"))
api(project(":bluetape4k-coroutines"))
compileOnly(libs.kotlinx.coroutines.core)
compileOnly(libs.kotlinx.coroutines.reactive)
compileOnly(libs.kotlinx.coroutines.reactor)
compileOnly(libs.okhttp3)
compileOnly(libs.okhttp3.coroutines)
compileOnly(libs.okhttp3.logging.interceptor)
compileOnly(libs.okhttp3.mockwebserver)
compileOnly(libs.httpclient5)

Treat compileOnly edges as caller-provided capabilities and verify runtime availability before using their APIs.

No module-level configuration resource was found under src/main/resources. Configuration is supplied through constructors, builders, function arguments, or the integrating framework; confirm defaults in source.

Failure semantics are defined by the linked entry points and tests, not inferred from the artifact name. Keep cancellation and timeout signals intact, close owned resources, and translate backend exceptions only at a boundary that can add a stable domain contract. Use the test anchors below to verify the exact behavior before adding retries or fallbacks.

Track payload size, allocation, latency, malformed-input rate, resource closure, and protocol errors. Keep capacity, timeout, retry, and shutdown settings next to the component that owns the resource; avoid process-wide defaults that hide which caller accepted the trade-off.

Run the module test task:

Terminal window
./gradlew :bluetape4k-http:test --no-configuration-cache

Representative test anchors:

No dedicated workshop path is registered in the manual manifest. Use the module README and the representative tests above as runnable evidence.

This page documents the repository state represented by the linked source and tests. It does not turn optional backends into application defaults or claim performance without a benchmark artifact. Re-check compatibility and lifecycle notes when the module version changes.

These diagrams are loaded directly from README assets published with the 1.11.0 release and pinned to its immutable commit. They describe this manual’s released structure and runtime flows, not later Snapshot changes. Select a preview to open the SVG at the same release commit.

HTTP client base throughput chart

Release README: io/http/README.md

HTTP client high-latency benchmark chart

Release README: io/http/README.md

Overall Architecture: Multi-Backend HTTP Client diagram

Section titled “Overall Architecture: Multi-Backend HTTP Client diagram”

Overall Architecture: Multi-Backend HTTP Client diagram

Release README: io/http/README.md

HTTP Client Hierarchy (HC5) diagram

Release README: io/http/README.md

OkHttp3 Client Hierarchy diagram

Release README: io/http/README.md

HTTP Client Primary Recommendations diagram

Section titled “HTTP Client Primary Recommendations diagram”

HTTP Client Primary Recommendations diagram

Release README: io/http/README.md

Profiling workflow

Release README: io/http/README.md

Profiling mode comparison

Release README: io/http/README.md

Async HTTP Request Flow (HC5 Async + Coroutines) diagram

Section titled “Async HTTP Request Flow (HC5 Async + Coroutines) diagram”

Async HTTP Request Flow (HC5 Async + Coroutines) diagram

Release README: io/http/README.md