Releases: eed3si9n/gigahorse
0.7.0
Gigahorse 0.7.0 is published for Scala 3, 2.13, and 2.12.
Apache HTTP Components support
Gigahorse 0.7.0 adds support for Apache HTTP Components (HttpAsyncClient).
scala> import gigahorse.*, support.apachehttp.Gigahorse
scala> import scala.concurrent.*, duration.*
scala> val http = Gigahorse.http(Gigahorse.config)
val http: gigahorse.HttpClient = gigahorse.support.apachehttp.ApacheHttpClient@3960b18a
scala> val r = Gigahorse.url("https://api.duckduckgo.com").get.
| addQueryString("q" -> "1 + 1")
val r: gigahorse.Request = Request(https://api.duckduckgo.com, GET, EmptyBody(), Map(), Map(q -> List(1 + 1)), None, None, None, None, None, None)
scala> val f = http.run(r, Gigahorse.asString andThen {_.take(60)})
val f: concurrent.Future[String] = Future(<not completed>)
scala> Await.result(f, 120.seconds)
val res0: String = <!DOCTYPE html><html lang="en-US" class="no-js has-zcm no-t
scala> http.close()
Other Changes
New Contributors
Full Changelog: v0.6.0...v0.7.0
Documentation: https://eed3si9n.com/gigahorse/
0.6.0
0.5.0
0.4.0
- Updates underlying Square OkHttp to 3.14.0
- Updates underlying Akka HTTP to 10.1.8
- Fixes
DownloadHandler
to close the file channel #36 by @jkugiya - Fixes shaded AHC-Client properties #55 by @jtjeferreira
- Fixes
DelimitedPublisher
#38 by @volth - Fixes
underlying
method onStream
#61 by @eed3si9n - Build updates from @giabao, @xuwei-k, and @sullis
0.3.1
SignatureCalculator
Gigahorse 0.3.1 expands the SignatureCalculator
to be a generic/common way to add a signature http header derived from url and content.
#26 by @alexdupre
Form support for Akka HTTP binding
This also adds form support for Akka HTTP binding.
0.3.0
0.2.0
AHC 2.0 and (experimental) Akka HTTP backend
Gigahorse 0.2.0 abstracts over two HTTP backends.
@alexdupre contributed migration from AHC 1.9 to AHC 2.0, which is based on Netty 4 in #12.
There's now also an experimental Akka HTTP support. #15 by @eed3si9n
WebSocket support
@alexdupre also contributed WebSocket support.
Async processing with Reactive Stream
Thanks to Lightbend implementing Reactive Stream on both Akka HTTP and AHC #963, Gigahorse can abstract over both backends as Reactive Stream of byte or String stream.
The stream processing is provided using http.runStream(r, f)
.
import gigahorse._, support.akkahttp.Gigahorse
import scala.concurrent._, duration._
Gigahorse.withHttp(Gigahorse.config) { http =>
val r = Gigahorse.url("http://localhost:8000/README.markdown").get
val f = http.runStream(r, Gigahorse.asStringStream andThen { xs =>
xs.foreach { s => println(s) }
})
Await.result(f, 120.seconds)
}