Spray 介绍
Spray 是一个开源的 REST/HTTP 工具包和底层网络 IO 包,基于
Scala 和
Akka 构建。轻量级、异步、非堵塞、基于 actor 模式、模块化和可测试是 spray
的特点。
示例代码:
val responses: Future[Seq[HttpResponse]] = HttpDialog(host = "img.example.com", port = 8888) .send(HttpRequest(GET, "a.gif")) .send(HttpRequest(GET, "b.gif")) .send(HttpRequest(GET, "c.gif")) .end