File tree Expand file tree Collapse file tree 2 files changed +8
-11
lines changed
android/src/main/java/io/deckers/blob_courier/send Expand file tree Collapse file tree 2 files changed +8
-11
lines changed Original file line number Diff line number Diff line change @@ -59,21 +59,21 @@ class BlobSender(
5959
6060 val response = sendRequestCall.execute()
6161
62- val responseBody = response.body() ?.string().orEmpty()
62+ val responseBody = response.body?.string().orEmpty()
6363
6464 li(" Finished unmanaged send" )
6565
6666 return Success (
6767 mapOf (
6868 " response" to mapOf (
69- " code" to response.code() ,
69+ " code" to response.code,
7070 " data" to if (senderParameters.returnResponse) responseBody else " " ,
71- " headers" to mapHeadersToMap(response.headers() )
71+ " headers" to mapHeadersToMap(response.headers)
7272 )
7373 )
7474 )
7575 } catch (e: IOException ) {
76- if (sendRequestCall.isCanceled) {
76+ if (sendRequestCall.isCanceled() ) {
7777 return Failure (createErrorFromThrowable(ERROR_CANCELED_EXCEPTION , e))
7878 }
7979
Original file line number Diff line number Diff line change @@ -32,11 +32,8 @@ import io.deckers.blob_courier.common.maybe
3232import io.deckers.blob_courier.common.right
3333import io.deckers.blob_courier.common.testKeep
3434import io.deckers.blob_courier.common.validationContext
35- import io.deckers.blob_courier.upload.FilePayload
36- import io.deckers.blob_courier.upload.StringPayload
37- import io.deckers.blob_courier.upload.UploaderParameters
38- import okhttp3.MediaType
39- import okhttp3.MultipartBody
35+ import okhttp3.MediaType.Companion.toMediaType
36+ import okhttp3.MediaType.Companion.toMediaTypeOrNull
4037import okhttp3.RequestBody
4138import java.net.URL
4239
@@ -61,8 +58,8 @@ data class SenderParameters(
6158
6259fun SenderParameters.toRequestBody (contentResolver : ContentResolver ): RequestBody =
6360 InputStreamRequestBody (
64- mediaType.let ( MediaType ::parse )
65- ? : MediaType .get( DEFAULT_MIME_TYPE ),
61+ mediaType.toMediaTypeOrNull( )
62+ ? : DEFAULT_MIME_TYPE .toMediaType( ),
6663 contentResolver,
6764 absoluteFilePath
6865 )
You can’t perform that action at this time.
0 commit comments