blob: c54c61572f480e31bc6d04861995eec0aa19dafe (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
|
package com.softwaremill.sttp
import com.softwaremill.sttp.model.BasicRequestBody
/**
* Use the factory methods `multipart` to conveniently create instances of
* this class. A part can be then further customised using `fileName`,
* `contentType` and `header` methods.
*/
case class Multipart(name: String,
body: BasicRequestBody,
fileName: Option[String] = None,
contentType: Option[String] = None,
additionalHeaders: Map[String, String] = Map()) {
def fileName(v: String): Multipart = copy(fileName = Some(v))
def contentType(v: String): Multipart = copy(contentType = Some(v))
def header(k: String, v: String): Multipart =
copy(additionalHeaders = additionalHeaders + (k -> v))
}
|