https://github.com/gleapsdk/okhttpinterceptor
https://github.com/gleapsdk/okhttpinterceptor
Last synced: 11 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/gleapsdk/okhttpinterceptor
- Owner: GleapSDK
- Created: 2021-10-20T12:26:28.000Z (over 4 years ago)
- Default Branch: main
- Last Pushed: 2021-11-05T10:14:38.000Z (over 4 years ago)
- Last Synced: 2025-07-04T21:04:15.631Z (12 months ago)
- Language: Java
- Size: 112 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Gleap Android OKHttpInterceptor

Intercept your okhttp requests on andoird. This library uses [OkHttp](https://square.github.io/okhttp/) and [GleapSDK](https://github.com/GleapSDK/Android-SDK).
## Docs & Examples
Checkout our [documentation](https://docs.gleap.io/android/network-logs) for full reference.
## Installation with Maven
Open your project in your favorite IDE. (e.g. Android Studio). Open the **build.gradle** of your project.
**Scroll down to the dependencies**
```
dependencies {
...
}
```
**Add the OkHttp-Interceptor to your dependencies**
```
dependencies {
...
implementation group: 'io.gleap', name: 'gleap-okhttp-interceptor', version: '1.0.0'
}
```
Sync the gradle file to start the download of the library. 🎉
**Use the Interceptor**
This is the example of okhttp for intercepting request with a small adaption.
```
import io.gleap.GleapOkHttpInterceptor;
....
OkHttpClient client = new OkHttpClient.Builder()
.addInterceptor(new GleapOkHttpInterceptor())
.build();
Request request = new Request.Builder()
.url("http://www.publicobject.com/helloworld.txt")
.header("User-Agent", "OkHttp Example")
.build();
Response response = client.newCall(request).execute();
response.body().close();
```