Instantiate OkHttpClient once
@@ -9,6 +9,8 @@ import java.io.IOException
object ImageBinPoster {
+ private val client = OkHttpClient()
+
/**
* Post the image to ImageBin
*
@@ -51,8 +53,6 @@ object ImageBinPoster {
.post(requestBody)
.build()
- val client = OkHttpClient()
-
return Single.fromCallable { client.newCall(request).execute() }
}
