Fork me on GitHub
#aleph
<
2017-05-07
>
bradford00:05:06

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?

danielcompton20:05:10

Body for a ring request can kinda be whatever you want

danielcompton20:05:16

sometimes it's an input stream

danielcompton20:05:20

sometimes it's a string

danielcompton20:05:32

sometimes it's a hydrated JSON object

danielcompton20:05:50

depends what kind of middleware you're using

danielcompton20:05:36

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)

danielcompton20:05:26

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