{"id":20128576,"url":"https://github.com/gencloud/rest_client","last_synced_at":"2026-05-10T13:05:08.878Z","repository":{"id":244450399,"uuid":"202972566","full_name":"GenCloud/rest_client","owner":"GenCloud","description":null,"archived":false,"fork":false,"pushed_at":"2019-08-18T13:23:19.000Z","size":41,"stargazers_count":3,"open_issues_count":0,"forks_count":1,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-01-13T08:30:41.753Z","etag":null,"topics":["rest-client","spring-boot","webflux"],"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/GenCloud.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}},"created_at":"2019-08-18T07:19:07.000Z","updated_at":"2024-06-14T21:17:21.000Z","dependencies_parsed_at":"2024-06-14T19:58:28.095Z","dependency_job_id":"24f62c16-3dad-4649-9190-9765cef9f717","html_url":"https://github.com/GenCloud/rest_client","commit_stats":null,"previous_names":["gencloud/rest_client"],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/GenCloud%2Frest_client","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/GenCloud%2Frest_client/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/GenCloud%2Frest_client/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/GenCloud%2Frest_client/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/GenCloud","download_url":"https://codeload.github.com/GenCloud/rest_client/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":241572697,"owners_count":19984328,"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":["rest-client","spring-boot","webflux"],"created_at":"2024-11-13T20:28:06.611Z","updated_at":"2026-05-10T13:05:03.840Z","avatar_url":"https://github.com/GenCloud.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Rest Client module\n\n### Functional\n- initializing a rest request \"on one line\" using an interface in the style of spring repositories;\n- interceptors functionality before and after the request;\n- support reactive HTTP client.\n\n### Intro\nAdd Rest Client to your project. for maven projects just add this dependency:\n```xml\n    \u003crepositories\u003e\n        \u003crepository\u003e\n            \u003cid\u003erestclient\u003c/id\u003e\n            \u003curl\u003ehttps://raw.github.com/GenCloud/rest_client/channel/\u003c/url\u003e\n            \u003csnapshots\u003e\n                \u003cenabled\u003etrue\u003c/enabled\u003e\n                \u003cupdatePolicy\u003ealways\u003c/updatePolicy\u003e\n            \u003c/snapshots\u003e\n        \u003c/repository\u003e\n    \u003c/repositories\u003e\n    \n    \u003cdependencies\u003e\n        \u003cdependency\u003e\n            \u003cgroupId\u003eorg.restclient\u003c/groupId\u003e\n            \u003cartifactId\u003erestclient\u003c/artifactId\u003e\n            \u003cversion\u003e0.0.1\u003c/version\u003e\n        \u003c/dependency\u003e\n    \u003c/dependencies\u003e\n```\n\nA typical use of IoC would be:\n```java\n@SpringBootApplication\npublic class MainTest {\n    public static void main(String... args) {\n        SpringApplication.run(MainTest.class, args);\n    }\n}\n```\n\nA component usage would be:\n```java\n@Mapping(alias = \"github-service\") //annotation of component marked is a rest client service\npublic interface RestGateway {\n\t/**\n\t * Get all repos met-information by user name.\n\t *\n\t * @param userName - github user name\n\t * @return json string\n\t */\n\t@ServiceMapping(path = \"/users/${userName}/repos\", method = GET) //annotation marked is a method calling rest resource\n\t@Type(type = ArrayList.class)\n\tMono\u003cArrayList\u003e getRepos(@PathVariable(\"userName\") String userName);\n}\n```\n\nA component dependency usage would be:\n```java\n    @Autowired // marked field for scanner found dependency\n    private RestGateway restGateway;\n```\n\nCreate custom interceptor.\n```java\n@RestInterceptor(aliases = \"github-service\") // marked as intercept request for github-service\n@Slf4j\npublic class TestInterceptor implements Interceptor {\n\t@Override\n\tpublic void preHandle(Object[] args, Object body, HttpHeaders headers) {\n\t\tif (log.isDebugEnabled()) {\n\t\t\tlog.debug(\"Pre handling request of github-service, args: [{}], body: [{}], headers: [{}]\", args, body, headers);\n\t\t}\n\t}\n\n\t@Override\n\tpublic void postHandle(ResponseEntity\u003c?\u003e responseEntity) {\n\t\tif (log.isDebugEnabled()) {\n\t\t\tlog.debug(\"Post handling request of github-service, entity: [{}]\", responseEntity);\n\t\t}\n\t}\n}\n```\n\nUsage:\n```java\n@SpringBootApplication\npublic class MainTest {\n    public static void main(String... args) {\n        final ConfigurableApplicationContext context = SpringApplication.run(MainTest.class, args);\n        final RestGateway restGateway = channel.getType(RestGateway.class);\n        final Mono\u003cArrayList\u003e response = restGateway.getRepos(\"gencloud\");\n        response.doOnSuccess(list -\u003e \n                log.info(\"Received response: {}\", list))\n            .subscribe();\n    }\n}\n```\n\n### Contribute\nPull requests are welcomed!!\n\nThe license is [GNU GPL V3](https://www.gnu.org/licenses/gpl-3.0.html/).\n\nThis library is published as an act of giving and generosity, from developers to developers. \n\n_GenCloud_\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgencloud%2Frest_client","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgencloud%2Frest_client","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgencloud%2Frest_client/lists"}