{"id":31970516,"url":"https://github.com/hubspot/horizon","last_synced_at":"2025-10-14T19:16:00.829Z","repository":{"id":20689564,"uuid":"23972840","full_name":"HubSpot/Horizon","owner":"HubSpot","description":null,"archived":false,"fork":false,"pushed_at":"2025-08-29T15:53:38.000Z","size":355,"stargazers_count":24,"open_issues_count":5,"forks_count":8,"subscribers_count":152,"default_branch":"master","last_synced_at":"2025-08-29T18:47:02.208Z","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":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/HubSpot.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,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2014-09-12T18:55:45.000Z","updated_at":"2025-08-29T15:53:39.000Z","dependencies_parsed_at":"2022-07-12T15:17:50.311Z","dependency_job_id":"722b558b-c600-45f3-b256-71a61826fe4a","html_url":"https://github.com/HubSpot/Horizon","commit_stats":null,"previous_names":[],"tags_count":34,"template":false,"template_full_name":null,"purl":"pkg:github/HubSpot/Horizon","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/HubSpot%2FHorizon","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/HubSpot%2FHorizon/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/HubSpot%2FHorizon/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/HubSpot%2FHorizon/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/HubSpot","download_url":"https://codeload.github.com/HubSpot/Horizon/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/HubSpot%2FHorizon/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":279020649,"owners_count":26086895,"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","status":"online","status_checked_at":"2025-10-14T02:00:06.444Z","response_time":60,"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":"2025-10-14T19:15:55.567Z","updated_at":"2025-10-14T19:16:00.821Z","avatar_url":"https://github.com/HubSpot.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Horizon\n\nJava HTTP client interfaces designed to make interacting with REST services as user-friendly as possible. Horizon classes use intuitive, fluent APIs and leverage Jackson internally so that reading and writing JSON are first-class citizens.\n\n## Features\n- Clean, simple interfaces\n- Designed to work with JSON\n- GZIP and Snappy support for compression/decompression\n- Built-in retry functionality with exponential backoff\n- Free to mix and match synchronous and asynchronous clients\n\n## Usage\n\nThe HorizonCore module contains all of the interfaces and domain objects. Horizon comes with two implementations, packaged in separate artifacts. The HorizonApache module contains an implementation of the synchronous `HttpClient` interface, built on top of Apache's httpclient 4. The HorizonNing module contains an implementation of both `HttpClient` and `AsyncHttpClient` built on top of org.asynchttpclient.shaded:async-http-client. So if you just want to use the Apache-based client, you would add the following Maven dependency:\n\n```xml\n\u003cdependency\u003e\n  \u003cgroupId\u003ecom.hubspot\u003c/groupId\u003e\n  \u003cartifactId\u003eHorizonApache\u003c/artifactId\u003e\n  \u003cversion\u003e0.2.0\u003c/version\u003e\n\u003c/dependency\u003e\n```\n\nAnd then you can instantiate a new `HttpClient` by doing `HttpClient httpClient = new ApacheHttpClient();`\n\n## Examples\n\nUsing the synchronous `HttpClient` to retrieve a single `Widget` by ID:\n\n```java\npublic Widget getById(int id) {\n    HttpRequest request = HttpRequest.newBuilder().setUrl(\"http://widgets/\" + id).build();\n    // Jackson is used to convert JSON response to Widget object\n    return httpClient.execute(request).getAs(Widget.class);\n}\n```\n\nUpdating a widget:\n\n```java\npublic Widget update(Widget widget) {\n    HttpRequest request = HttpRequest.newBuilder()\n            .setMethod(Method.PUT)\n            .setUrl(\"http://widgets/\" + widget.getId())\n            .setBody(widget) // Jackson is used to convert Widget to JSON\n            .build();\n    \n    return httpClient.execute(request).getAs(Widget.class);\n}\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhubspot%2Fhorizon","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fhubspot%2Fhorizon","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhubspot%2Fhorizon/lists"}