Gigahorse 0.3.0


Gigahorse 0.3.0 is now released. See documentation on what it is.

OkHttp support

0.3.0 adds Square OkHttp support. Gigahorse-OkHttp is availble for Scala 2.10, 2.11, and 2.12.

According to the JavaDoc you actually don't have to close the OkHttpClient instance.

scala> import gigahorse._, support.okhttp.Gigahorse
import gigahorse._
import support.okhttp.Gigahorse
scala> import scala.concurrent._, duration._
import scala.concurrent._
import duration._
scala> val http = Gigahorse.http(Gigahorse.config) // don't have to close
http: gigahorse.HttpClient =

However, you must close the response object if you don't consume the body contents.
Normally you'd consume the body content as Gigahorse.asString or something like that.
In that sense, the design is similar to Akka HTTP.

scala> val r = Gigahorse.url("").get.
     |           addQueryString(
     |             "q" -> "1 + 1",
     |             "format" -> "json"
     |           )
r: gigahorse.Request = Request(, GET, EmptyBody(), Map(), Map(q -> List(1 + 1), format -> List(json)), None, None, None, None, None, None)
scala> val f =, { res: FullResponse =>
     |   res.close() // must close if you don't consume the body
     |   1
     | })
f: scala.concurrent.Future[Int] = Future(<not completed>)
scala> Await.result(f, 120.seconds)
res0: Int = 1

OkHttp also does not provide streaming body or Reactive stream support, so if you need that check out Akka HTTP-backed or AHC-backed Gigahorse.

Shaded AHC 2.0

Gigahorse now shades AHC 2.0.