This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2020-02-24
Channels
- # announcements (5)
- # aws (24)
- # babashka (41)
- # beginners (130)
- # bristol-clojurians (2)
- # calva (39)
- # chlorine-clover (64)
- # cider (30)
- # clojure (202)
- # clojure-belgium (1)
- # clojure-dev (99)
- # clojure-europe (5)
- # clojure-hungary (4)
- # clojure-italy (10)
- # clojure-losangeles (8)
- # clojure-nl (11)
- # clojure-norway (6)
- # clojure-spec (7)
- # clojure-uk (12)
- # clojurescript (52)
- # core-typed (26)
- # cursive (19)
- # data-science (19)
- # datomic (19)
- # duct (10)
- # emacs (17)
- # fulcro (22)
- # graalvm (11)
- # jobs (3)
- # kaocha (28)
- # leiningen (6)
- # lumo (2)
- # malli (10)
- # nrepl (2)
- # off-topic (23)
- # pathom (2)
- # pedestal (7)
- # re-frame (3)
- # reagent (30)
- # reitit (2)
- # remote-jobs (2)
- # shadow-cljs (77)
- # sql (10)
- # test-check (22)
- # tools-deps (37)
- # vscode (1)
- # yada (3)
Hi, everyone
I don't know how I could write a test for the part of out API (that is implemented in pedestal)
that accepts a file and uses Ring multi-part interceptor ? (Can I use the pedestal.test/response-for
here
the same way I used it for body params and such ? How should I construct the request and how should I feed the file to response-for
?)
It will be great if anyone could help me
Thanks in advance
@UU0F762AU, that’s a great question. Yes you can. I’ve added a sample of how you’d construct the request to the cookbook documentation (http://pedestal.io/cookbook/index#_how_to_test_your_servlet_based_service). I’ve pasted the relevant bits above.
Hi Thank you for your answer I have another issue about this subject How can we add also a simple key value near my file in the request body? Thank you for your time.
@UBZ3VLMKJ it’s just a matter of adding additional fields wrapped by the boundary. The fields in the above sample do no need to be files
Thanks a lot @U0FL657GR
@U0FL657GR Sorry another question, here you have sent a string file. But I want to send xlsx files. Can I use the same method for sending ?