{"id":20019419,"url":"https://github.com/tambapps/hyperpoet","last_synced_at":"2025-05-04T23:31:54.088Z","repository":{"id":42674691,"uuid":"356050775","full_name":"tambapps/hyperpoet","owner":"tambapps","description":"a Groovy-friendly and Marcel-friendly HTTP client backed by OkHttp","archived":false,"fork":false,"pushed_at":"2025-03-13T17:54:26.000Z","size":555,"stargazers_count":5,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-04-08T14:12:06.002Z","etag":null,"topics":["groovy","http","http-client"],"latest_commit_sha":null,"homepage":"https://github.com/tambapps/hyperpoet/wiki","language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/tambapps.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}},"created_at":"2021-04-08T21:20:00.000Z","updated_at":"2025-03-13T17:54:30.000Z","dependencies_parsed_at":"2023-11-25T23:23:35.830Z","dependency_job_id":"27a4e5e0-4449-460f-b134-52cdf2d03996","html_url":"https://github.com/tambapps/hyperpoet","commit_stats":null,"previous_names":[],"tags_count":8,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tambapps%2Fhyperpoet","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tambapps%2Fhyperpoet/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tambapps%2Fhyperpoet/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tambapps%2Fhyperpoet/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/tambapps","download_url":"https://codeload.github.com/tambapps/hyperpoet/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252414389,"owners_count":21744097,"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":["groovy","http","http-client"],"created_at":"2024-11-13T08:27:31.194Z","updated_at":"2025-05-04T23:31:53.605Z","avatar_url":"https://github.com/tambapps.png","language":"Java","readme":"# Hyperpoet\n\nHyperpoet is a Marcel and Groovy-friendly HTTP client written in Java 8 backed by OkHttp.\n\n\nThe main goal of this library is to be able to perform HTTP requests with as less code as possible.\nIt is\n\nFor that, several functionalities were implemented\n\n- **Automatic I/O handling** :\nNo need to open and close Input/OutputStream, the poet does it for you\n\n- **Automatic response body parsing** :\nThe poet automatically parse the response's data given its `Content-Type` header. You can also explicitly specify it yourself.\n\n- **Automatic request body composing** : \nThe client/poet automatically compose the request's body (if any) given a provided content type.\n\n\nYou can also find features such as\n- customize error handling\n- handle authentication\n- get history of requests/responses\n- perform requests using Domain Specific Language\n- printing request/responses (on a Linux terminal, useful with [groovysh](https://groovy-lang.org/groovysh.html))\n\nCheck out the full doc [here](https://github.com/tambapps/hyperpoet/wiki)\n\n## How to use\nThe library is in Maven central.\n\nYou can import it to your project with Maven\n\n```xml\n  \u003cdependency\u003e\n    \u003cgroupId\u003ecom.tambapps.http\u003c/groupId\u003e\n    \u003cartifactId\u003ehyperpoet-groovy\u003c/artifactId\u003e\n    \u003cversion\u003e1.4.0\u003c/version\u003e\n  \u003c/dependency\u003e\n```\n\n\nOr Gradle\n\n```groovy\nimplementation 'com.tambapps.http:hyperpoet-groovy:1.4.0'\n```\n\n\nOr see [this link](https://central.sonatype.com/artifact/com.tambapps.http/hyperpoet-groovy/1.4.0)\nfor other dependency management tools.\n\n## Examples\n\n### Get an url\n\n```groovy\nimport com.tambapps.http.hyperpoet.HttpHaiku\n\nHttpPoet poet = new HttpPoet(url: API_URL)\ndef posts = poet.get(\"/posts\", params: [author: 'someone@gmail.com'])\nprocessPosts(posts)\n// or if you don't want to instantiate a Poet\ndef todos = HttpHaiku.get(\"$API_URL/todos\", [author: 'someone@gmail.com'])\n```\n\n### Post data\n```groovy\nHttpPoet poet = new HttpPoet(url: API_URL, contentType: ContentType.JSON)\nnewPost = [title: 'a new post', author: 'me@gmail.com', body: 'This is new!']\ntry {\n  poet.post(\"/posts\", body: newPost)\n} catch (ErrorResponseException e) {\n  println \"Couldn't create new post!\"\n}\n// or if you don't want to instantiate a Poet\nHttpHaiku.post(\"$API_URL/todos\", contentType: ContentType.JSON, body: newPost)\n```\n\n### Printing request/response data\n\n![Example](https://github.com/tambapps/hyperpoet/blob/main/examples/example.png?raw=true)\n\n\n","funding_links":[],"categories":["HTTP"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftambapps%2Fhyperpoet","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftambapps%2Fhyperpoet","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftambapps%2Fhyperpoet/lists"}