{"id":17152037,"url":"https://github.com/dtboy1995/android-sex-http","last_synced_at":"2026-03-10T17:05:42.968Z","repository":{"id":101940407,"uuid":"91551482","full_name":"dtboy1995/android-sex-http","owner":"dtboy1995","description":":airplane: android async http simple wrapper with cache policy for rest api","archived":false,"fork":false,"pushed_at":"2018-11-22T07:35:21.000Z","size":645,"stargazers_count":9,"open_issues_count":0,"forks_count":2,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-04-13T12:46:24.964Z","etag":null,"topics":["android","async","cache","http","https","sex","simple"],"latest_commit_sha":null,"homepage":"https://ithot.org","language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/dtboy1995.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2017-05-17T08:20:25.000Z","updated_at":"2023-09-08T17:25:08.000Z","dependencies_parsed_at":null,"dependency_job_id":"2cb65e14-f1f7-42e5-8f07-c69beb6c34fc","html_url":"https://github.com/dtboy1995/android-sex-http","commit_stats":null,"previous_names":[],"tags_count":8,"template":false,"template_full_name":null,"purl":"pkg:github/dtboy1995/android-sex-http","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dtboy1995%2Fandroid-sex-http","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dtboy1995%2Fandroid-sex-http/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dtboy1995%2Fandroid-sex-http/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dtboy1995%2Fandroid-sex-http/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/dtboy1995","download_url":"https://codeload.github.com/dtboy1995/android-sex-http/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dtboy1995%2Fandroid-sex-http/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":30343836,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-03-10T15:55:29.454Z","status":"ssl_error","status_checked_at":"2026-03-10T15:54:58.440Z","response_time":106,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"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","async","cache","http","https","sex","simple"],"created_at":"2024-10-14T21:42:37.871Z","updated_at":"2026-03-10T17:05:42.938Z","avatar_url":"https://github.com/dtboy1995.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"# ![android-sex-http](static/icon.png)\n\n# android-sex-http [![Build Status](https://travis-ci.org/dtboy1995/android-sex-http.svg?branch=master)](https://travis-ci.org/dtboy1995/android-sex-http)\n:airplane: android async http simple wrapper with cache policy\n\n# install\n```gradle\nimplementation 'org.ithot.android.transmit:http:0.3.2'\n```\n\n# usage\n- ### permissions\n```xml\n  \u003cuses-permission android:name=\"android.permission.INTERNET\" /\u003e\n  \u003cuses-permission android:name=\"android.permission.ACCESS_NETWORK_STATE\" /\u003e\n```\n- ### jsonserializer\n```gradle\nimplementation 'org.ithot.android.serializer:gson:1.0.1'\n```\n- ### sample\n```java\npublic class Dummy {\n  public String id;\n}\n```\n```java\n// init once\nReq.init(context, new JSON());\n// send request\nReq.build(context)\n   .url(\"https://ithot.org/dummy\")\n   .res(new Res\u003cDummy\u003e(){\n     @Override\n     public void ok(Header[] headers, Dummy response) {\n\n     }\n\n     @Override\n     public void no(Header[] headers, String error) {\n     }\n   })\n   .go();\n```\n- ### config\n```java\n// default http 80 https 443\nReq.init(context, serialier);\n// set http port\nReq.init(context, 3000, serialier);\n// set https port\nReq.init(context, 3000, 5000, serialier)\n// set base url example for https://api.somedomain.com\nReq.base(\"https://ithot.org\");\n// distinguish different users request\nReq.prefix(\"user_id\");\n// if true log response default false\nReq.debug(true);\n// http lifecycle hooks\nReq.hook(new IHTTPHook(){\n  // no network call this hook\n  @Override\n  public void disconnected(Context context) {\n\n  }\n  // you can set common headers\n  @Override\n  public List\u003cHeader\u003e headers() {\n\n  }\n  // before request call this hook, you can display a dialog\n  @Override\n  public void pre(Context context) {\n\n  }\n  // request done call this hook, you can dismiss a dialog\n  @Override\n  public void post(Context context) {\n\n  }\n  // abnormal response call this hook\n  @Override\n  public void fail(Header[] headers, String response, Context context) {\n\n  }\n});\n```\n\n- ### custom json serializer\n```java\npublic class Serializer extends JSONSerializer {\n    // you can use any serialization library such as Gson Fastjson etc example below\n    private Gson gson = new Gson();\n\n    @Override\n    public Object parse(String json, Type type) {\n        return gson.fromJson(json, type);\n    }\n\n    @Override\n    public String stringify(Object object) {\n        return gson.toJson(object);\n    }\n}\nReq.init(context, new Serializer());\n```\n\n- ### download (break restoration)\n```xml\n\u003cuses-permission android:name=\"android.permission.READ_EXTERNAL_STORAGE\" /\u003e\n\u003cuses-permission android:name=\"android.permission.WRITE_EXTERNAL_STORAGE\" /\u003e\n```\n```java\nFile file = new File(Environment.getExternalStorageDirectory() + File.separator + \"test.mp3\");\nReq.build(context)\n   .base(false)\n   .url(\"https://ithot.org/music\")\n   .res(new FileRes() {\n        @Override\n        public void done(File f) {\n        }\n\n        @Override\n        public void undone() {\n        }\n\n        @Override\n        public void progress(int rate) {\n        }\n\n    })\n  .download(file);\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdtboy1995%2Fandroid-sex-http","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdtboy1995%2Fandroid-sex-http","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdtboy1995%2Fandroid-sex-http/lists"}