/docs/ja/00.md
https://github.com/eed3si9n/gigahorse · Markdown · 86 lines · 63 code · 23 blank · 0 comment · 0 complexity · 30e8896b3b4ca8fd8bfb2f9ab072a53a MD5 · raw file
- ---
- out: index.html
- ---
- [AHC]: https://github.com/AsyncHttpClient/async-http-client/tree/1.9.x
- [netty]: http://netty.io
- [okhttp]: http://square.github.io/okhttp/
- [sslconfig]: https://github.com/lightbend/ssl-config
- [config]: https://github.com/lightbend/config
- [ws]: https://www.playframework.com/documentation/2.5.x/ScalaWS
- [dispatch]: https://dispatchhttp.org/Dispatch.html
- [contraband]: http://www.scala-sbt.org/contraband/
- [akkahttp]: http://doc.akka.io/docs/akka-http/current/scala.html
- [@wsargent]: https://github.com/wsargent
- [@n8han]: https://github.com/n8han
- [@Duhemm]: https://github.com/Duhemm
- [@alexdupre]: https://github.com/alexdupre
- Gigahorse
- =========
- Gigahorse は、Scala のための HTTP クライアントで、内部に [Square OkHttp][okhttp] か [Async Http Client][AHC] か [Akka HTTP][akkahttp] を使うことができる。
- ### セットアップ
- Square OkHttp を使う場合:
- ```scala
- libraryDependencies += "com.eed3si9n" %% "gigahorse-okhttp" % "$gigahorse_version$"
- ```
- Async HTTP Client を使う場合:
- ```scala
- libraryDependencies += "com.eed3si9n" %% "gigahorse-asynchttpclient" % "$gigahorse_version$"
- ```
- Akka HTTP は現段階では実験的サポート:
- ```scala
- libraryDependencies += "com.eed3si9n" %% "gigahorse-akka-http" % "$gigahorse_version$"
- ```
- ### ライブラリ依存性
- Gigahorse-OkHttp は、Scala と [Square OkHttp][okhttp] に依存する。
- 他に [Lightbend SSL Config][sslconfig]、そして [Lightbend Config][config] にも依存している。
- Gigahorse-AsyncHttpClient は、Scala、[AHC 2.0][AHC] (これは [Netty 4][netty] に依存している)、
- Gigahorse-Akka-HTTP は現状では実験段階で、実装されていない機能もある。
- ### 謝辞
- - 実装の大半は、AHC の呼び出し方や設定のデフォルト値なども含め [The Play WS API][ws] をベースとした。
- 特に設定に関しては [Lightbend Config][config] と [@wsargent][@wsargent] の [SSL Config][sslconfig]
- を採用しており、よりセキュアなデフォルトになっている。
- - API の設計に関しては [@n8han][@n8han] の [Dispatch Reboot][dispatch] に強い影響を受けている。
- - データ型の全ては [@Duhemm][@Duhemm] と僕が作った [Contraband][contraband] を使って自動生成されている。
- - [@alexdupre][@alexdupre] は AHC 2.0 へのマイグレーションと WebSocket サポートをコントリビュートしてくれた。
- - 実際の HTTP の仕事をしている HTTP ライブラリにこの場を借りて感謝したい。
- ### ライセンス
- Apache v2
- ### クイックスタート
- Gigahorse を使った簡単な GET 呼び出しの例をみてみよう:
- ```console
- scala> import gigahorse._, support.okhttp.Gigahorse
- scala> import scala.concurrent._, duration._
- scala> val http = Gigahorse.http(Gigahorse.config)
- scala> val r = Gigahorse.url("https://api.duckduckgo.com").get.
- addQueryString(
- "q" -> "1 + 1"
- )
- scala> val f = http.run(r, Gigahorse.asString andThen {_.take(60)})
- scala> Await.result(f, 120.seconds)
- scala> http.close()
- ```
- <div style="margin: 100px"></div>
- 