$ show kittinunf/fuel
Fuel is a Kotlin Multiplatform HTTP networking library built on kotlinx.coroutines, providing suspend-style HTTP verbs (GET, POST, PUT, PATCH, DELETE, HEAD, arbitrary methods) plus Server-Sent Events streaming across JVM, Apple (iOS/macOS), and WasmJS targets. The core fuel module uses an expect/actual split: a common HttpLoader interface and FuelBuilder are backed by OkHttp on JVM, NSURLSession on Apple, and the browser fetch API on WasmJS. A global Fuel object supports plugging in a custom loader or loader factory, and extension functions on String (httpGet(), httpPost(), etc.) provide concise request entry points. A FuelRouting interface lets applications model typed API endpoints as sealed classes. Four optional serialization modules — fuel-jackson-jvm, fuel-moshi-jvm, fuel-kotlinx-serialization, and fuel-forge-jvm — each add a small extension on HttpResponse (toJackson, toMoshi, toJson, toForge) that decodes the body and returns a Result from the companion Result library. The core response model is deliberately minimal: a mutable HttpResponse holding a status code, a kotlinx.io Source body stream, and headers. JVM request handling is semantically correct about HTTP (e.g., consulting OkHttp's HttpMethod.permitsRequestBody before attaching a body). The project is published as 3.0.0-alpha04, uses Kotlin 2.3 / Gradle 9.3 / OkHttp 5 alpha, and is actively maintained with CI, Renovate, Dependabot, and ktlint. JVM has solid unit coverage using MockWebServer for all verbs, routing, custom OkHttp configurations, and each serialization adapter. Apple and Wasm targets are implemented but largely untested outside manual samples, and the Apple SSE implementation is a naive full-body line splitter rather than true incremental streaming. Overall this is a clean, modern, well-organized library with a couple of genuinely reusable pieces (notably the Android-derived UriCodec port) and some pre-1.0 rough edges. This is a pure application/library repository, not a data project.
The LLM identified 3 files worth highlighting for reuse:
UriCodec performs RFC-aware percent-encoding/decoding of URI components with options for plus-to-space conversion and strict vs. lenient decoding (invalid octets become U+FFFD instead of throwing). It is a self-contained Kotlin object with zero dependencies outside the stdlib — a faithful, optimized port of AOSP's UriCodec that can be dropped into any JVM/Android/Kotlin-Multiplatform project needing query/path encoding. Demonstrates chunked lazy encoding to avoid per-character allocations, byte-accumulator decoding with explicit buffer-flush bookkeeping, and configurable failure modes.
fillURLWithParameters appends a list of key/value pairs to a URL as a properly encoded query string, correctly handling URLs that already contain a '?' and encoding both keys and values via UriCodec. It is a tiny, dependency-light URL-building utility that any HTTP client or API wrapper could adopt as-is. Demonstrates idempotent query-string composition with correct delimiter semantics.
Converts an OkHttp Call into either a suspend function returning a fully-buffered response or a cold Flow<String> of Server-Sent Events. performAsyncWithSSE is a compact reference implementation of SSE consumption with kotlinx.coroutines: it uses callbackFlow, reads lines in a useLines loop, forwards data: payloads, closes the flow on error, and closes the underlying OkHttp response both on completion and in awaitClose for cancellation. The pattern can be extracted into any OkHttp+coroutines project; the only fuel-specific dependency is the HttpResponse return type.