Fork me on GitHub

Hello, I have a question. I am trying to set up a server that can receive and process multipart messages. My attempt is with aleph with yada resources. But I have difficulties in processing the in the response. Do you have some tips and tricks? I am trying to use parse-multipart in this way:

     (yada/resource {:methods
                     {:post {:consumes "multipart/form-data"
                             :produces "application/json"
                             :response (fn [ctx]
                                         (let [boundary (last (clojure.string/split (get-in ctx [:request :headers "content-type"]) #"="))]
                                           (try   (->> (get-in ctx [:request :body])
                                                       (yada.multipart/parse-multipart boundary 10000 1000)
                                                       ( (xf-bytes->content))
                                                  (catch Exception e
                                                    (println (.getMessage e)))))
                                         ( {:success true}))}}})]
    {:port        1234
     :raw-stream? true
     :executor    (flow/utilization-executor 0.9 64)})