简体   繁体   中英

Server.route does not conform to the expected type requestcontext [Akka,Scala]

I am trying to play around with this example http://doc.akka.io/docs/akka-stream-and-http-experimental/1.0-M2/scala/http/directives/coding-directives/decodeRequest.html

1 def routesWithCompression = {


2   time() {
3     count() {
4       decodeRequest(Gzip) {

5            entity(as[String]) { content: String =>
6              complete(s"Request content: '$content'")
7          }
8          }

9       }
10      }
11 }

I get compile error at line 8 stating

Expression of type server.route does not conform to requestcontext

Honestly, I can't figure out which requires RequestContext as input and how to convert server.route to type RequestContext.

Thanks

That's an outdated experimental version. If you're using a more recent version of Akka Streams/HTTP, there is a good chance the old code won't compile or run. You might want to review the latest Akka-HTTP encoding/decoding example instead.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM