{"id":21127340,"url":"https://github.com/kshitij86/offred-android","last_synced_at":"2026-04-26T08:38:00.621Z","repository":{"id":112063838,"uuid":"271549065","full_name":"kshitij86/offred-android","owner":"kshitij86","description":"Make simple API requests from your apps, easily.","archived":false,"fork":false,"pushed_at":"2020-09-18T14:31:33.000Z","size":258,"stargazers_count":4,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-06-11T19:39:21.780Z","etag":null,"topics":["android","android-library","api-client","java"],"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/kshitij86.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,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2020-06-11T13:09:39.000Z","updated_at":"2020-09-18T14:31:36.000Z","dependencies_parsed_at":null,"dependency_job_id":"83489252-690c-4d62-93b6-26c2aaeb9f62","html_url":"https://github.com/kshitij86/offred-android","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/kshitij86/offred-android","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kshitij86%2Foffred-android","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kshitij86%2Foffred-android/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kshitij86%2Foffred-android/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kshitij86%2Foffred-android/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/kshitij86","download_url":"https://codeload.github.com/kshitij86/offred-android/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kshitij86%2Foffred-android/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32291260,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-26T08:29:33.829Z","status":"ssl_error","status_checked_at":"2026-04-26T08:29:18.366Z","response_time":129,"last_error":"SSL_read: 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","android-library","api-client","java"],"created_at":"2024-11-20T04:48:32.194Z","updated_at":"2026-04-26T08:38:00.593Z","avatar_url":"https://github.com/kshitij86.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Offred\n\n#### Offred eliminates the need to construct complicated classes for simple API requests for your apps. \n\n# Add dependency\n\n1. Add it in your root build.gradle at the end of repositories:\n```\nallprojects {\n\t\trepositories {\n\t\t\t...\n\t\t\tmaven { url 'https://jitpack.io' }\n\t\t}\n\t}\n```\n\n2. Add the dependency\n```\ndependencies {\n\t        implementation 'com.github.kshitij86:offred-android:\u003clatest-release\u003e'\n\t}\n```\nThe example application shows usages in an actual app environment.\n\n# Usage\n\n### _GET_ requests\n\n    Offred.get(url)\n    API calls are made on a separate background thread and a Response object is returned.\n\n```\n\ttry{\n        Offred offred = new Offred();\n        Future\u003cResponse\u003e fr =  offred.get(\"https://jsonplaceholder.typicode.com/todos/1\");\n        Response data = fr.get();\n        if(!data.isException \u0026\u0026 data.resBody != \"NULL_REQUEST\"){\n            Log.d(TAG, \"onClick: Call to web service successful\");\n            }\n        } catch (Exception e){\n            Log.e(TAG, e.getMessage());\n        }\n```\n\n### _POST_ requests\n    Offred.post(url, postData)\n```\n    try{\n            ...\n            // JSON to POST to RESTful API\n            String passJSON = \"{\\\"name\\\":\" + name.getText() + \",\\\"salary\\\":\" + salary.getText() + \",\\\"age\\\":\"+ age.getText() +\"}\";\n            \n            Offred offred = new Offred();\n            Future\u003cResponse\u003e fr = offred.post(\"https://dummy.restapiexample.com/api/v1/create\", passJSON);\n            Response data = fr.get();\n            ...\n       } catch (Exception e){\n            Log.e(TAG, e.getMessage());\n        }\n```\n\n### _DELETE_ requests\n    Offred.delete(url)\n\n\n### `RESPONSE` object\nPerforming a HTTP request returns a `Response` object, which contains response body along with response headers, total request time etc. \nBelow is a full list.\n\n| ```Response data```|```Type```|\n|---------------|-------------|\n| ```time```    |  ```double```    |\n| ```resBody```|  ```JSONObject```|\n| ```statusCode```| ```int```   |\n| ```headers```   | ```Map\u003cString, List\u003cString\u003e\u003e``` |\n| ```isException```   | ```Boolean``` |\n\n\n# Future Scope \u0026 TODOs\n1. Better `Exception` handling\n2. Extend HTTP requests\n3. Caching support\n4. Support for XML data\n\n# Demo App\nThe app included with repo showcases use cases for Offred.\n[Demo app](ss.jpeg)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkshitij86%2Foffred-android","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkshitij86%2Foffred-android","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkshitij86%2Foffred-android/lists"}