{"id":37019593,"url":"https://github.com/vanillasource/gerec","last_synced_at":"2026-01-14T02:10:57.366Z","repository":{"id":14549981,"uuid":"64400056","full_name":"vanillasource/gerec","owner":"vanillasource","description":"The Generic HTTP Rest Client","archived":false,"fork":false,"pushed_at":"2023-04-17T09:16:38.000Z","size":674,"stargazers_count":5,"open_issues_count":2,"forks_count":1,"subscribers_count":2,"default_branch":"master","last_synced_at":"2026-01-11T18:28:35.636Z","etag":null,"topics":[],"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/vanillasource.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}},"created_at":"2016-07-28T13:59:44.000Z","updated_at":"2023-11-14T14:39:53.000Z","dependencies_parsed_at":"2022-07-23T11:02:32.444Z","dependency_job_id":null,"html_url":"https://github.com/vanillasource/gerec","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"purl":"pkg:github/vanillasource/gerec","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vanillasource%2Fgerec","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vanillasource%2Fgerec/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vanillasource%2Fgerec/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vanillasource%2Fgerec/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/vanillasource","download_url":"https://codeload.github.com/vanillasource/gerec/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vanillasource%2Fgerec/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28408711,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-14T01:52:23.358Z","status":"online","status_checked_at":"2026-01-14T02:00:06.678Z","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":[],"created_at":"2026-01-14T02:10:56.904Z","updated_at":"2026-01-14T02:10:57.352Z","avatar_url":"https://github.com/vanillasource.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"![Build Status](https://img.shields.io/travis/vanillasource/gerec.svg)\n![Published Version](https://img.shields.io/maven-central/v/com.vanillasource.gerec/gerec-parent.svg)\n\nGerec, the Generic REST HTTP Client\n===================================\n\nA small wrapper over HTTP Clients to support building a proper RESTful\n(Hypertext-enabled) API client. Specific features:\n\n* Media-type centered\n* Following links made easy\n* Navigating complex use-cases made easy\n* Easy cache control\n* Conditional requests\n* Very simple and minimal API\n* Asynchronous design\n* Zero-copy operation possible\n\n### Getting the library\n\nAdd this dependency to your Maven build:\n\n```xml\n\u003cdependency\u003e\n   \u003cgroupId\u003ecom.vanillasource.gerec\u003c/groupId\u003e\n   \u003cartifactId\u003egerec\u003c/artifactId\u003e\n   \u003cversion\u003e2.0.0\u003c/version\u003e\n\u003c/dependency\u003e\n```\n\nTo include the \"API\" of Gerec. If you want to instantiate a `ResourceReference` you\nneed to include `gerec-httpclient` for example to use the Apache HttpClient implementation.\nTo use Jackson for the media-types, include `gerec-jackson`.\n\n### The basics\n\nThe central concept in Gerec is a `ResourceReference`. This is\nan object that can be used to manipulate the remote resource it points to.\nThese references are not instantiated by the user, as often is the case with other\nframeworks, but they are created by following links or submitting forms. The only exception is the very\nfirst reference, created from a bookmark to some entry point into a web of resources.\n\nThe reference contains the usual methods to manipulate the resource it points to:\n* `GET`\n* `POST`\n* `PUT`\n* `DELETE`\n* `HEAD`\n* `OPTIONS`\n\nThe result of any of the HTTP methods will result in a `Response`. A `Response` can contain\na response body, the format of which is described by a `MediaType`. The content of the `Response` might / should also\ninclude additional information for making subsequent requests, such as links (additional\n`ResourceReference` objects) or forms.\n\n### Some random examples\n\nSimple `GET` requests are made the following way:\n\n```java\nString body = reference.get(MediaTypes.textPlain()).join();\n```\n\nMedia types can be freely created for any representation, as they should be. So `GET`ting\na complex object looks like this:\n\n```java\nPerson person = reference.get(Person.MEDIA_TYPE).join();\n```\n\nThe given media type will be properly communicated to the server, using the normal HTTP\ncontent negotiation mechanisms.\n\nYou can also easily make conditional requests. The following example gets a mutable `Person` object, modifies it,\nthen tries to update the server, but only if it did not change since it was requested. (Also\nknown as optimistic locking):\n\n```java\nResponse\u003cPerson\u003e personResponse = currentUserReference.getResponse(Person.TYPE).join();\nPerson person = personResponse.getContent();\nperson.setName(\"New Name\");\ncurrentUserReference.put(person, personResponse.ifMatch()).join();\n```\n\nThe `ifMatch()` condition above will use the `ETag` of the response to make the `PUT` conditional\nupon the person not having been changed since it was requested.\n\n### Documentation\n\nThe Gerec [API Documentation](http://vanillasource.github.io/gerec/apidocs/).\n\nPlease visit the [Gerec Wiki](https://github.com/vanillasource/gerec/wiki) for more information.\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvanillasource%2Fgerec","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fvanillasource%2Fgerec","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvanillasource%2Fgerec/lists"}