This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2017-05-07
Channels
- # aleph (8)
- # beginners (16)
- # boot (5)
- # cider (22)
- # cljs-dev (15)
- # clojars (10)
- # clojure (94)
- # clojure-dusseldorf (1)
- # clojure-france (57)
- # clojure-greece (1)
- # clojure-spec (9)
- # clojurescript (15)
- # core-async (6)
- # cursive (11)
- # datomic (10)
- # emacs (6)
- # funcool (1)
- # hoplon (1)
- # off-topic (5)
- # re-frame (8)
- # spacemacs (8)
- # specter (4)
- # unrepl (10)
- # vim (5)
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?
Body for a ring request can kinda be whatever you want
sometimes it's an input stream
sometimes it's a string
sometimes it's a hydrated JSON object
depends what kind of middleware you're using
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
)
I think a Netty HttpRequest
is much more bare, just method, URI, and protocol version