【发布时间】:2015-01-24 08:37:09
【问题描述】:
HTTP GET 示例与喷雾is simple:
import spray.routing.SimpleRoutingApp
object Main extends App with SimpleRoutingApp {
implicit val system = ActorSystem("my-system")
startServer(interface = "localhost", port = 8080) {
path("hello") {
get {
complete {
<h1>Say hello to spray</h1>
}
}
}
}
}
所以如果我想执行 HTTP POST,我可以使用 post 指令。但是我怎样才能对所有的 HTTP 方法做出响应呢?像这样的:
startServer(interface = "localhost", port = 8080) {
path("hello") {
all { // - here something like all derective
complete ("I do not care.")
}
}
}
是否有all 指令或类似的指令?
【问题讨论】: