aboutsummaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authoradamw <adam@warski.org>2017-08-29 14:39:41 +0200
committeradamw <adam@warski.org>2017-08-29 14:39:41 +0200
commitacbf6567533011afe0479dffefa3a918fc570f32 (patch)
tree1e9d079d08514e1e4f4154198f9bf1e732cc075d /tests
parent0ff548cbbe6f0c7eb054597ff693f9bfbec3a65b (diff)
downloadsttp-acbf6567533011afe0479dffefa3a918fc570f32.tar.gz
sttp-acbf6567533011afe0479dffefa3a918fc570f32.tar.bz2
sttp-acbf6567533011afe0479dffefa3a918fc570f32.zip
Multipart support in async http client
Diffstat (limited to 'tests')
-rw-r--r--tests/src/test/scala/com/softwaremill/sttp/BasicTests.scala10
1 files changed, 10 insertions, 0 deletions
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()
+ }
}
}