diff options
Diffstat (limited to 'okhttp-client-handler')
-rw-r--r-- | okhttp-client-handler/src/main/scala/com/softwaremill/sttp/okhttp/OkHttpClientHandler.scala | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/okhttp-client-handler/src/main/scala/com/softwaremill/sttp/okhttp/OkHttpClientHandler.scala b/okhttp-client-handler/src/main/scala/com/softwaremill/sttp/okhttp/OkHttpClientHandler.scala index 79ca98b..f7c4466 100644 --- a/okhttp-client-handler/src/main/scala/com/softwaremill/sttp/okhttp/OkHttpClientHandler.scala +++ b/okhttp-client-handler/src/main/scala/com/softwaremill/sttp/okhttp/OkHttpClientHandler.scala @@ -49,19 +49,19 @@ abstract class OkHttpClientHandler[R[_], S](client: OkHttpClient) private def setBody(requestBody: RequestBody[S]): Option[OkHttpRequestBody] = { requestBody match { case NoBody => None - case StringBody(b, encoding) => + case StringBody(b, encoding, _) => Some(OkHttpRequestBody.create(MediaType.parse(encoding), b)) - case ByteArrayBody(b) => Some(OkHttpRequestBody.create(null, b)) - case ByteBufferBody(b) => Some(OkHttpRequestBody.create(null, b.array())) - case InputStreamBody(b) => + case ByteArrayBody(b, _) => Some(OkHttpRequestBody.create(null, b)) + case ByteBufferBody(b, _) => + Some(OkHttpRequestBody.create(null, b.array())) + case InputStreamBody(b, _) => Some(new OkHttpRequestBody() { override def writeTo(sink: BufferedSink): Unit = sink.writeAll(Okio.source(b)) override def contentType(): MediaType = null }) - case PathBody(b) => Some(OkHttpRequestBody.create(null, b.toFile)) - case SerializableBody(f, t) => setBody(f(t)) - case StreamBody(s) => None + case PathBody(b, _) => Some(OkHttpRequestBody.create(null, b.toFile)) + case StreamBody(s) => None } } |