{"id":49815472,"url":"https://github.com/studioidan/HttpAgent","last_synced_at":"2026-05-29T21:00:50.594Z","repository":{"id":216179114,"uuid":"60009701","full_name":"studioidan/HttpAgent","owner":"studioidan","description":"super simple library to manage http requests.","archived":false,"fork":false,"pushed_at":"2018-06-05T10:49:52.000Z","size":106,"stargazers_count":35,"open_issues_count":8,"forks_count":14,"subscribers_count":1,"default_branch":"master","last_synced_at":"2026-01-30T08:32:42.643Z","etag":null,"topics":["android","android-http-request","http-agent","rest-api"],"latest_commit_sha":null,"homepage":"","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/studioidan.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,"governance":null,"roadmap":null,"authors":null}},"created_at":"2016-05-30T12:49:07.000Z","updated_at":"2025-07-15T03:08:19.000Z","dependencies_parsed_at":"2024-01-08T21:03:57.195Z","dependency_job_id":"9cc41c9e-f491-4b73-b656-33ed84167e89","html_url":"https://github.com/studioidan/HttpAgent","commit_stats":null,"previous_names":["studioidan/httpagent"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/studioidan/HttpAgent","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/studioidan%2FHttpAgent","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/studioidan%2FHttpAgent/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/studioidan%2FHttpAgent/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/studioidan%2FHttpAgent/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/studioidan","download_url":"https://codeload.github.com/studioidan/HttpAgent/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/studioidan%2FHttpAgent/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":33670211,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-05-29T02:00:06.066Z","response_time":107,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":["android","android-http-request","http-agent","rest-api"],"created_at":"2026-05-13T06:00:43.975Z","updated_at":"2026-05-29T21:00:50.588Z","avatar_url":"https://github.com/studioidan.png","language":"Java","funding_links":[],"categories":["HTTP客户端"],"sub_categories":["微服务框架"],"readme":"# HttpAgent\nsuper simple library to manage http requests.\n\nGradle\n------\n```groovy\n\ndependencies {\n    implementation 'com.studioidan.httpagent:httpagent:1.0.16@aar'\n}\n\n```\n\n\nNow see how easy it becomes with HttpAgent!\n-------------------------------------------\n\nGet Request\n------\n```groovy\nHttpAgent.get(\"www.example.com/api/books\")\n                    .goJson(new JsonCallback() {\n                        @Override\n                        protected void onDone(boolean success, JSONObject jsonObject) {\n                            \n                        }\n                    });\n```\n\nor you can go jsonArray like so\n```groovy\nHttpAgent.get(\"www.example.com/api/books\")\n                    .goJsonArray(new JsonArrayCallback() {\n                        @Override\n                        protected void onDone(boolean success, JSONArray jsonArray) {\n                            \n                        }\n                    });\n```\nNeed to add url parameters? no problem!\n------\n```groovy\nHttpAgent.get(\"www.example.com/api/books\")\n                    .queryParams(\"key_1\",\"value_1\",\"key_2\",\"value_2\",\"key_N\",\"value_N\")\n                    .goJsonArray(new JsonArrayCallback() {\n                        @Override\n                        protected void onDone(boolean success, JSONArray jsonArray) {\n                            \n                        }\n                    });\n```\nPost? Put? Delete? of course...\n------\n```groovy\nHttpAgent.post(\"www.example.com/api/books\");\nHttpAgent.put(\"www.example.com/api/books\");\nHttpAgent.delete(\"www.example.com/api/books\")\n```\n\nAdding body is also simple...\n------\n```groovy\nHttpAgent.post(\"www.example.com/api/books\")\n                    .queryParams(\"key_1\",\"value_1\",\"key_2\",\"value_2\",\"key_N\",\"value_N\")\n                    .withBody(\"{name:popapp ,age:27}\")\n                    .goJsonArray(new JsonArrayCallback() {\n                        @Override\n                        protected void onDone(boolean success, JSONArray jsonArray) {\n\n                        }\n                    });\n```\n\nOr even more simple...\n------\n```groovy\nHttpAgent.post(\"www.example.com/api/books\")\n                    .queryParams(\"key_1\",\"value_1\",\"key_2\",\"value_2\",\"key_N\",\"value_N\")\n                    .withBody(\"key_1\",\"value_1\",\"key_2\",\"value_2\",\"key_N\",\"value_N\") // will be converted to json\n                    .goJsonArray(new JsonArrayCallback() {\n                        @Override\n                        protected void onDone(boolean success, JSONArray jsonArray) {\n\n                        }\n                    });\n```\n\nDon't forget the headers...\n------\n```groovy\nHttpAgent.get(\"http://192.168.88.253/Video/inputs/channels/1\")\n                        .headers(\"Authorization\", \"Basic YWRtaW46P3V5YFZhNzAw\", \"Content-Type\", \"application/json\")\n                        .goString(new StringCallback() {\n                            @Override\n                            protected void onDone(boolean success, String stringResults) {\n                                Log.d(TAG, stringResults);\n                            }\n                        });\n```\nAny request can be made with one of the following callbacks:\n------\n\nGet a string results\n------\n```groovy\ngoString(new StringCallback() {\n                        @Override\n                        protected void onDone(boolean success, String results) {\n                            \n                        }\n                    })\n```\n\nGet Json results\n------\n```groovy\ngoJson(new JsonCallback() {\n                        @Override\n                        protected void onDone(boolean success, JSONObject jsonObject) {\n                            \n                        }\n                    })\n```\n\nGet JsonArray results\n------\n```groovy\ngoJsonArray(new JsonArrayCallback() {\n                        @Override\n                        protected void onDone(boolean success, JSONArray jsonArray) {\n\n                        }\n                    });\n```\n\nGet no results, Just send the request\n------\n```groovy\ngo(new SuccessCallback() {\n                        @Override\n                        protected void onDone(boolean success) {\n                            \n                        }\n                    })\n```\n\nYou also have access to those on any callback\n------\n```groovy\nHttpAgent.post(\"www.example.com/api/books\")\n                    .queryParams(\"key_1\",\"value_1\",\"key_2\",\"value_2\",\"key_N\",\"value_N\")\n                    .withBody(\"{name:popapp ,age:27}\")\n                    .goJson(new JsonCallback() {\n                        @Override\n                        protected void onDone(boolean success, JSONObject jsonObject) {\n                            getErrorMessage(); //returns error message if exists.\n                            getResponseCode(); // well, it's obvious...\n                            getStringResults(); // returns results as as string.\n                        }\n                    });\n```\n\n                    \n  \n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fstudioidan%2FHttpAgent","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fstudioidan%2FHttpAgent","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fstudioidan%2FHttpAgent/lists"}