funcool

A channel for discussing and asking questions about Funcool libraries https://github.com/funcool/
kenny 2016-10-28T21:17:55.000180Z

@niwinz Best way to attach the parsed :body with body-params and the :body as a string on the context?

kenny 2016-10-28T22:01:03.000181Z

I came up with

(defn body->string
  [ctx]
  (ct/delegate
    {:body-str
     (when-let [body ^TypedData (:body ctx)]
       (-> body .getBytes String.))}))
It's not my favorite solution because it also requires you to include catacumba.handlers.parse/read-body before the body->string handler. Would it make sense to add the option to include the body string to catacumba.handlers.parse/body-params?