Skip to content

Latest commit

 

History

History
22 lines (19 loc) · 481 Bytes

README.md

File metadata and controls

22 lines (19 loc) · 481 Bytes

okcurl

curl log for okhttp!

implementation 'com.werb.okcurl:okcurl:0.0.1'

add OkCurl Interceptor for okhttp

val curlInterceptor = OkCurl("RequestService")
val client = OkHttpClient.Builder()
    .addInterceptor(curlInterceptor)
    .build()
val requestType = intent.getStringExtra(REQUEST_TYPE)
val request = RequestFactory.getRequest(requestType)
try {
    client.newCall(request).execute()
} catch (e: IOException) {
    e.printStackTrace()
}