I think there's an inconsistancy with these two de...
# ktor
d
I think there's an inconsistancy with these two definitions I think:``` /** * Builds a route to match
POST
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()
?
c
How do we know what to receieve in the second case?
d
Same thing, a reified fun, can call
post<Foo> { foo ->  }
, that's what I thought it would do...
c
Sorry, I don't get your point. The first function is used when <R> type is known at compile time. The second one provides ability to programmatically decide which type to receive or even discard request body
d
The first has a path parameter, the second doesn't (like when it's already nested in a route), so sometimes I know R at compile time, but I don't have a path to specify... @cy