pedestal

Ho0man 2020-02-24T10:31:23.003100Z

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

mh.meraji 2020-02-25T11:48:07.004300Z

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.

2020-02-25T22:19:16.004800Z

@mh.meraji12 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

2020-02-26T11:32:06.005Z

Thanks a lot @ddeaguiar

2020-02-26T11:44:55.005400Z

@ddeaguiar 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 ?

2020-02-26T11:44:58.005600Z

Thanks again

2020-02-24T23:21:29.003400Z

@dr.w.breen, 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.