i'm trying to use spray detach as following:
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>
}
}
}
}
}
but i get following compilation error:
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 ^
I looked at: https://github.com/spray/spray/wiki/Detach and I still have no idea what i'm doing wrong...