From acbf6567533011afe0479dffefa3a918fc570f32 Mon Sep 17 00:00:00 2001 From: adamw Date: Tue, 29 Aug 2017 14:39:41 +0200 Subject: Multipart support in async http client --- tests/src/test/scala/com/softwaremill/sttp/BasicTests.scala | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'tests') diff --git a/tests/src/test/scala/com/softwaremill/sttp/BasicTests.scala b/tests/src/test/scala/com/softwaremill/sttp/BasicTests.scala index b2918fa..9b686dc 100644 --- a/tests/src/test/scala/com/softwaremill/sttp/BasicTests.scala +++ b/tests/src/test/scala/com/softwaremill/sttp/BasicTests.scala @@ -548,6 +548,16 @@ class BasicTests val resp = req.send().force() resp.body should be("p1=v1 (f1), p2=v2 (f2)") } + + name should "send a multipart message with a file" in { + val f = File.newTemporaryFile().write(testBody) + try { + val req = + mp.multipartBody(multipart("p1", f.toJava), multipart("p2", "v2")) + val resp = req.send().force() + resp.body should be(s"p1=$testBody (${f.name}), p2=v2") + } finally f.delete() + } } } -- cgit v1.2.3