/notes/0.1.0.markdown

https://github.com/eed3si9n/gigahorse · Markdown · 25 lines · 19 code · 6 blank · 0 comment · 0 complexity · e4585e5e3f878aa9e013373368b70455 MD5 · raw file

  1. This is the initial release of Gigahorse, an HTTP client for Scala.
  2. Heres a quick example of how to make a `GET` call using Gigahorse:
  3. scala> import gigahorse._
  4. import gigahorse._
  5. scala> import scala.concurrent._, duration._
  6. import scala.concurrent._
  7. import duration._
  8. scala> Gigahorse.withHttp(Gigahorse.config) { http =>
  9. val r = Gigahorse.url("http://api.duckduckgo.com").get.
  10. addQueryString(
  11. "q" -> "1 + 1",
  12. "format" -> "json"
  13. )
  14. val f = http.run(r, Gigahorse.asString andThen {_.take(60)})
  15. Await.result(f, 120.seconds)
  16. }
  17. res0: String = {"DefinitionSource":"","Heading":"1+1","ImageWidth":0,"Relat
  18. For more info, see [the Gigahorse docs][docs].
  19. [docs]: http://eed3si9n.com/gigahorse/