Skip to content

Instantly share code, notes, and snippets.

@pfcoperez
Created September 2, 2016 15:05
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save pfcoperez/1fc3a24a89e3f719edfe6033de89b0d5 to your computer and use it in GitHub Desktop.
Save pfcoperez/1fc3a24a89e3f719edfe6033de89b0d5 to your computer and use it in GitHub Desktop.
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