{"id":21586736,"url":"https://github.com/behringer24/serviceclient","last_synced_at":"2025-03-18T09:17:10.932Z","repository":{"id":10943234,"uuid":"13251105","full_name":"behringer24/ServiceClient","owner":"behringer24","description":"Java/Android class for easy web service requests. Response can be plain text or JSON. Uses HttpUrlConnection","archived":false,"fork":false,"pushed_at":"2017-12-29T23:02:32.000Z","size":97,"stargazers_count":3,"open_issues_count":0,"forks_count":1,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-01-24T15:41:51.870Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/behringer24.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2013-10-01T18:02:17.000Z","updated_at":"2021-07-11T21:38:51.000Z","dependencies_parsed_at":"2022-08-28T11:24:33.450Z","dependency_job_id":null,"html_url":"https://github.com/behringer24/ServiceClient","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/behringer24%2FServiceClient","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/behringer24%2FServiceClient/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/behringer24%2FServiceClient/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/behringer24%2FServiceClient/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/behringer24","download_url":"https://codeload.github.com/behringer24/ServiceClient/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244189826,"owners_count":20412991,"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-24T15:14:31.974Z","updated_at":"2025-03-18T09:17:10.908Z","avatar_url":"https://github.com/behringer24.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"# ServiceRequest\n\nA utility Java class developed for Android to handle easy web service requests. The response can be plain text or JSON. For the low level connection HttpUrlConnection is used.\n\n## Features\n\n- easy handling of POST and GET requests\n- supports String or JSONObject as response types\n- supports Multipart-Form-Data POST for uploading files\n\n## How to include the dependency using JitPack.io\n\n[![](https://jitpack.io/v/behringer24/ServiceClient.svg)](https://jitpack.io/#behringer24/ServiceClient)\n\nStep 1. Add the JitPack repository to your build file\nAdd it in your root build.gradle at the end of repositories:\n```gradle\nallprojects {\n\t\trepositories {\n\t\t\t...\n\t\t\tmaven { url 'https://jitpack.io' }\n\t\t}\n\t}\n```\nStep 2. Add the dependency\n```gradle\ndependencies {\n\t        compile 'com.github.behringer24:ServiceClient:1.1'\n\t}\n```\n\n## Example code\n\nString es response\n```java\nServiceClient service = new ServiceClient(\"http://yoursite.com/api/service\", RequestMethod.POST);\nservice.addParameter(\"name\", \"Max Mustermann\");\nservice.addParameter(\"email\", \"max@mustermann.com\");\n\ntry {\n\tString response = service.request();\n} catch {IOException e} {\n\t// handle connection errors\n}\n```\n\nJSONObject as response\n```java\nServiceClient service = new ServiceClient(\"http://yoursite.com/api/jsonService\", RequestMethod.POST);\nservice.addParameter(\"name\", \"Max Mustermann\");\nservice.addParameter(\"email\", \"max@mustermann.com\");\n\ntry {\n\tJSONObject response = service.requestJson();\n} catch {IOException e} {\n\t// handle connection errors\n} catch {JSONException e}\n\t// handle JSON parse errors\n}\n```\n\nPlease remember to put network access in AsyncTask to keep it out of the UI-thread\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbehringer24%2Fserviceclient","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbehringer24%2Fserviceclient","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbehringer24%2Fserviceclient/lists"}