Skip to content
This repository was archived by the owner on Feb 5, 2026. It is now read-only.

Latest commit

 

History

History
21 lines (17 loc) · 544 Bytes

File metadata and controls

21 lines (17 loc) · 544 Bytes

chttp

Chromatic HTTP, a simple Kotlin HTTP library.


info

Only supports GET and POST request right now. POST requests can only send json, jsonld, css, csv, eventstream, html, javascript, plain, xml types.

example

I'll make better example at some point.

val client = Client()

fun postExample(): Response {
    val url = URI("https://example.com").toURL()
    val request = Request(Methods.POST, url)
    val content = Content(ContentTypes.JSON, "{ \"key\": \"value\" }")
    return client.post(request, content)
}