aleph

bradford 2017-05-07T00:17:06.160876Z

Hi! I need to manually turn a Netty request into a Ring request. I'm trying to use aleph.http.core/netty-request->ring-request (I know this is frowned upon). What type is body supposed to be, and where does it come from? Isn't that already contained in the HttpRequest from Netty?

danielcompton 2017-05-07T20:29:10.377506Z

Body for a ring request can kinda be whatever you want

danielcompton 2017-05-07T20:29:16.377829Z

sometimes it's an input stream

danielcompton 2017-05-07T20:29:20.378079Z

sometimes it's a string

danielcompton 2017-05-07T20:29:32.378655Z

sometimes it's a hydrated JSON object

danielcompton 2017-05-07T20:29:50.379603Z

depends what kind of middleware you're using

danielcompton 2017-05-07T20:34:36.395792Z

In aleph, I think it's coerced to an input-stream mostly: https://github.com/ztellman/aleph/blob/cc0f2a5319fef6c0cde4372c7435316aef27a960/src/aleph/http/server.clj#L253-L275 (see the args to handle-request)

danielcompton 2017-05-07T20:37:26.405246Z

I think a Netty HttpRequest is much more bare, just method, URI, and protocol version