dave08
11/15/2018, 5:00 PMPOST
requests with specified [path] receiving request body content of type [R]
*/
@ContextDsl
@JvmName("postTyped")
inline fun <reified R : Any> Route.post(
path: String,
crossinline body: suspend PipelineContext<Unit, ApplicationCall>.(R) -> Unit
): Route {
return route(path, HttpMethod.Post) {
handle {
body(call.receive())
}
}
}
/**
* Builds a route to match POST
requests
*/
@ContextDsl
fun Route.post(body: PipelineInterceptor<Unit, ApplicationCall>): Route {
return method(HttpMethod.Post) { handle(body) }
}
```
Shouldn't the second also do call.receive()
?cy
11/15/2018, 8:09 PMdave08
11/15/2018, 8:47 PMpost<Foo> { foo -> }
, that's what I thought it would do...cy
11/16/2018, 9:48 PMdave08
11/17/2018, 4:44 PM