This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2021-07-04
Channels
- # announcements (10)
- # babashka (16)
- # beginners (3)
- # calva (14)
- # clj-kondo (119)
- # clojure (15)
- # clojure-nl (2)
- # clojure-uk (2)
- # clojurescript (15)
- # conjure (1)
- # datascript (1)
- # duct (1)
- # fulcro (2)
- # lsp (6)
- # malli (1)
- # off-topic (9)
- # polylith (3)
- # re-frame (9)
- # reagent (12)
- # reitit (6)
- # shadow-cljs (27)
- # sql (14)
- # vim (5)
Reading about the https://cljdoc.org/d/metosin/reitit/0.5.13/api/reitit.ring.middleware.parameters, it says:
> Middleware to parse urlencoded parameters from the query string and form body (if the request is a url-encoded form). Adds the following keys to the request map:
> :query-params - a map of parameters from the query string
> :form-params - a map of parameters from the body
> :params - a merged map of all types of parameter
Is there any reason :body-params
is not included in the :params
map?
The project I am working on has a website and API, so requests will have either :form-params
(from the browser) or :body-params
(from an API client). At the moment I am doing this:
(let [body (val (first (select-keys (:parameters req) [:body :form])))
title (:title body)
message (:message body)]
...)
If :body-params
was included in :params
I could do this:
(let [params (:params req)
title (:title params)
message (:message params)]
...)
Hello, I'm trying to get the simple websocket handshake working from the aleph example at https://github.com/clj-commons/aleph/blob/master/examples/src/aleph/examples/websocket.clj I'm instead using reitit over compojure but I'm getting an error when I try to execute
@(http/websocket-client "")
Execution error (WebSocketHandshakeException) at io.netty.handler.codec.http.websocketx.WebSocketClientHandshaker13/verify (WebSocketClientHandshaker13.java:274).
Invalid handshake response getStatus: 500 Server Error
I tried comparing the requests receieve by my "echo" handler in reitit vs the one in compojure but they mostly look the same to me.Hi. I made a fork of ring-oauth2 which provides routes for reitit. https://github.com/green-coder/reitit-oauth2
Hey, is this still the most direct way to get an oauth2 setup with Reitit on the server?
Hey, is this still the most direct way to get an oauth2 setup with Reitit on the server?