{"id":19635727,"url":"https://github.com/codepath/cpasynchttpclient","last_synced_at":"2025-10-11T01:08:23.338Z","repository":{"id":48808226,"uuid":"199595143","full_name":"codepath/CPAsyncHttpClient","owner":"codepath","description":"Android CodePath AsyncHttpClient","archived":false,"fork":false,"pushed_at":"2021-11-22T20:31:24.000Z","size":247,"stargazers_count":8,"open_issues_count":0,"forks_count":7,"subscribers_count":6,"default_branch":"master","last_synced_at":"2023-06-30T02:12:07.007Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/codepath.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2019-07-30T07:06:10.000Z","updated_at":"2023-05-25T06:52:10.000Z","dependencies_parsed_at":"2022-09-26T20:11:51.325Z","dependency_job_id":null,"html_url":"https://github.com/codepath/CPAsyncHttpClient","commit_stats":null,"previous_names":["codepath/asynchttpclient"],"tags_count":0,"template":null,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/codepath%2FCPAsyncHttpClient","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/codepath%2FCPAsyncHttpClient/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/codepath%2FCPAsyncHttpClient/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/codepath%2FCPAsyncHttpClient/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/codepath","download_url":"https://codeload.github.com/codepath/CPAsyncHttpClient/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":224102058,"owners_count":17256084,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-11T12:26:43.989Z","updated_at":"2025-10-11T01:08:18.291Z","avatar_url":"https://github.com/codepath.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"# AsyncHttpClient library\n\nThis is a lightweight asynchronous HTTP client powered by [OkHttp](https://square.github.io/okhttp/) but with a significantly simplified and easier to use API design.\n\nThe goal of this library is to have an API that clearly and cleanly supports the following features:\n\n * Asynchronous network requests without any need for manual thread handling\n * Response `onSuccess` callbacks run on the mainthread (by default)\n * Easy way to catch all errors and failures and handle them\n * Easy pluggable Text, JSON, and Bitmap response handlers to parse the response\n\nThis client tries to follow a similar API inspired by this [older now deprecated android-async-http library](https://github.com/android-async-http/android-async-http).\n\n## Setup\n\nTo use this library, add the following to your `.gradle` file:\n\n```gradle\ndependencies {\n  implementation 'com.codepath.libraries:asynchttpclient:2.1.1'\n}\n```\n\n## Basic usage\n\n1. Make sure all network calls are using `https://` instead of `http://`\n\n2. Verify that network access is allowed via the `\u003cuses-permission\u003e`:\n\n    ```xml\n    \u003cmanifest xmlns:android=\"http://schemas.android.com/apk/res/android\"\n                 package=\"com.codepath.example\"\u003e\n\n           \u003cuses-permission android:name=\"android.permission.INTERNET\" /\u003e```\n    ```\n\n3. Add any networking calls by leveraging the `AsyncHttpClient`\n\n   ```java\n   AsyncHttpClient client = new AsyncHttpClient();\n   client.get(\"https://api.thecatapi.com/v1/images/search\", new TextHttpResponseHandler() {\n       @Override\n       public void onSuccess(int statusCode, Headers headers, String response) {\n           Log.d(\"DEBUG\", response);\n       }\n\n       @Override\n       public void onFailure(int statusCode, @Nullable Headers headers, String errorResponse, @Nullable Throwable throwable) {\n           Log.d(\"DEBUG\", errorResponse);\n       }\n   });\n   ```\n\n   This example uses `TextHttpResponseHandler` which presents the response as raw text. We could use the `JsonHttpResponseHandler` instead to have the API response automatically parsed for us into JSON. See [other example calls here](https://github.com/codepath/AsyncHttpClient/blob/master/example/src/main/java/com/codepath/example/TestActivity.java).\n\nFor more detailed usages, check out the [CodePath Async Http Client Guide](https://guides.codepath.com/android/Using-CodePath-Async-Http-Client).\n\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcodepath%2Fcpasynchttpclient","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcodepath%2Fcpasynchttpclient","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcodepath%2Fcpasynchttpclient/lists"}