# chuck **Repository Path**: qs_os/chuck ## Basic Information - **Project Name**: chuck - **Description**: No description available - **Primary Language**: Unknown - **License**: Apache-2.0 - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 2 - **Created**: 2021-04-18 - **Last Updated**: 2021-04-18 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README ## chuck chuck is a simple in-app HTTP inspector for OkHttp clients. chuck intercepts and persists all HTTP requests and responses inside your application, and provides a UI for inspecting their content. ## chuck includes: Intercepts HTTP network calls of the application. Store intercepted calls in database. Displaying of intercepted data in library UI. Supports deleting of retained data. Displays notification when library is recording network calls. ## Installation tutorial 1.For using chuck module in sample app,include the below library dependency in library/libs folder to generate hap/library.har: daocore.har greendao.har Add the dependencies in entry/build.gradle as below : dependencies { implementation project(path: ':library') } Add the dependencies in library/build.gradle as below : dependencies { implementation fileTree(dir: 'libs', include: ['*.jar', '*.har']) } 2. Using the library.har, make sure to add library.har file in the entry/libs folder along with below dependent library har file. daocore.har greendao.har Modify the dependencies in the entry/build.gradle file. dependencies { implementation fileTree(dir: 'libs', include: ['*.jar', '*.har']) } ## Usage Instructions 1) Add chuck Interceptor to Builder() method of OkHttpClient 2) Pass the openharmony context to the chuckIntercepter constructor in the addInterceptor() method of OkHttpClient 3) Use above OkHttpClient in application methods whenever requesting any network call. OkHttpClient getClient(Context context) { return new OkHttpClient.Builder() .addInterceptor(new ChuckInterceptor(context)) .addInterceptor(new HttpLoggingInterceptor().setLevel(HttpLoggingInterceptor.Level.BODY)) Retrofit retrofit = new Retrofit.Builder() .baseUrl("https://httpbin.org") .addConverterFactory(GsonConverterFactory.create()) .client(getClient()) .build(); return retrofit.create(HttpbinApi.class); .build(); } Note: example baseUrl can be "https://httpbin.org" chuck library Should start intercepting and recording http request/response of the application and show ongoing process in a notification. ## License Copyright (C) 2017 Jeff Gilfelt. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.