How to upload multipart params? When I do
(deftest ^:integration upload-csv-test
(is (= (http/post "<http://127.0.0.1:3333>"
[{:multipart {:name "file" :content (io/file (io/resource "valid.csv"))}}])
nil)))
I get error: java.lang.IllegalArgumentException: Key must be integer
@erwinrooijakkers you need to unwrap the outer vector and pass the arguments to :multipart
in a vector
Oh thanks, yes I had that, different error 🙂:
(deftest ^:integration upload-csv-test
(is (= (http/post "<http://127.0.0.1:3333>"
{:multipart [{:name "file" :content (io/file (io/resource "valid.csv"))}]})
nil)))
;; => error: java.lang.Exception: Multipart content cannot be nil
this indicates that (io/resource "valid.csv") returned nil
I see
Okay I get another 500 now
When running from cider test/resources are not included
Thanks now I get the error from the application itself 🙂
Works
Thanks @borkdude