0
我试图用喷雾分离如下:如何使用scala spray detach?
path("") {
get {
detach {
respondWithMediaType(`text/html`) { // XML is marshalled to `text/xml` by default, so we simply override here
complete {
<html>
<body>
<h1>Say hello to <i>spray-routing</i> on <i>Jetty</i>!</h1>
</body>
</html>
}
}
}
}
}
,但我得到以下编译错误:
type mismatch; found : spray.routing.RequestContext => Unit required: spray.routing.directives.DetachMagnet respondWithMediaType(
text/html
) { // XML is marshalled totext/xml
by default, so we simply override here ^
我看了看:https://github.com/spray/spray/wiki/Detach,我仍然不知道我在做什么错...