Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/danielceinos/cooper
Cool User agent interceptor for Okhttp3
https://github.com/danielceinos/cooper
agent android header interceptor kotlin kotlin-android kotlin-library library okhttp okhttp3 user-agent
Last synced: about 22 hours ago
JSON representation
Cool User agent interceptor for Okhttp3
- Host: GitHub
- URL: https://github.com/danielceinos/cooper
- Owner: danielceinos
- Created: 2019-06-14T07:17:21.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2020-04-15T10:09:17.000Z (over 4 years ago)
- Last Synced: 2023-10-20T09:13:35.656Z (about 1 year ago)
- Topics: agent, android, header, interceptor, kotlin, kotlin-android, kotlin-library, library, okhttp, okhttp3, user-agent
- Language: Kotlin
- Homepage:
- Size: 148 KB
- Stars: 31
- Watchers: 1
- Forks: 2
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
Cooper, interceptor for [OkHttp3](https://github.com/square/okhttp) to add bran new shine User-Agent header
--------[![](https://jitpack.io/v/danielceinos/User-Agent-Interceptor.svg)](https://jitpack.io/#danielceinos/User-Agent-Interceptor)
This interceptor adds a useful User Agent header value.
Following this format:
`User-Agent:Your awesome app name / 1.0.1(2830803); StandAloneInstall; (Google; Android SDK built for x86_64; SDK 28; Android 9)`
AppName / VersionName(VersionCode); Installer package; (manufacturer; model; SDK version; Android version code)
Usage
--------```kotlin
val client = OkHttpClient.Builder()
client.addInterceptor(CooperInterceptor(context))
```
Install
--------Last release:
[![](https://jitpack.io/v/danielceinos/User-Agent-Interceptor.svg)](https://jitpack.io/#danielceinos/User-Agent-Interceptor)
Add it in your root build.gradle at the end of repositories:
```groovy
allprojects {
repositories {
...
maven { url 'https://jitpack.io' }
}
}
```Add the dependency
```groovy
dependencies {
implementation 'com.github.danielceinos:Cooper:X.Y.Z'
}
```