Created
September 2, 2016 15:05
-
-
Save pfcoperez/1fc3a24a89e3f719edfe6033de89b0d5 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
post { | |
entity(as[Foo]) { rq: Foo => | |
complete("aa") | |
} ~ getRqEnt { | |
val foo = Foo("boo") | |
val ett = Await.result(Marshal(foo).to[RequestEntity], 100 millis) | |
//val recEtt = {"a" : "thx1138"} | |
str => { | |
println(ett) | |
println(str) | |
complete(str) | |
} | |
} | |
/*~ entity(as[JValue]) { ent => | |
val foo = Foo("boo") | |
val ett = Await.result(Marshal(foo).to[RequestEntity], 100 millis) | |
//val recEtt = {"a" : "thx1138"} | |
println(ett) | |
complete("ooooo") | |
}*/ | |
} | |
} ~ complete("Welcome to Crossdata HTTP Server") | |
val getRqEnt = extract[String] { rqCtx => | |
rqCtx.request.entity.toString | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment