khttp

khttp is a simple library for HTTP requests in Kotlin. It functions similarly to Python's requests module.

import khttp.get

fun main(args: Array<out String>) {
    // Get our IP
    println(get("http://httpbin.org/ip").jsonObject.getString("origin"))
    // Get our IP in a simpler way
    println(get("http://icanhazip.com").text)
}

Dependency

Stable

Stable releases are hosted on JCenter.

<repository>
  <id>jcenter</id>
  <url>http://jcenter.bintray.com/</url>
</repository>
<!-- ... -->
<dependency>
  <groupId>khttp</groupId>
  <artifactId>khttp</artifactId>
  <version>0.1.0</version>
</dependency>

GitHub