https://github.com/werbhelius/okcurl
cURL log for okhttp!
https://github.com/werbhelius/okcurl
android curl kotlin okhttp3
Last synced: 4 months ago
JSON representation
cURL log for okhttp!
- Host: GitHub
- URL: https://github.com/werbhelius/okcurl
- Owner: werbhelius
- Created: 2018-09-05T14:47:17.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2018-09-10T01:55:14.000Z (over 6 years ago)
- Last Synced: 2024-12-07T12:11:27.794Z (6 months ago)
- Topics: android, curl, kotlin, okhttp3
- Language: Kotlin
- Homepage:
- Size: 136 KB
- Stars: 3
- Watchers: 2
- Forks: 2
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# okcurl
> curl log for okhttp!```gradle
implementation 'com.werb.okcurl:okcurl:0.0.1'
```add `OkCurl` Interceptor for okhttp
```kotlin
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()
}
```