{"id":18402007,"url":"https://github.com/onionpancakes/hop","last_synced_at":"2025-04-12T17:53:34.112Z","repository":{"id":151056507,"uuid":"459469734","full_name":"onionpancakes/hop","owner":"onionpancakes","description":"Minimal wrapper around the JDK HttpClient","archived":false,"fork":false,"pushed_at":"2024-07-01T07:48:51.000Z","size":114,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-02-16T03:41:24.240Z","etag":null,"topics":["client","http"],"latest_commit_sha":null,"homepage":"","language":"Clojure","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/onionpancakes.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":"2022-02-15T07:20:11.000Z","updated_at":"2024-07-01T07:48:54.000Z","dependencies_parsed_at":"2023-10-16T16:27:57.857Z","dependency_job_id":"4dc24581-fe27-427a-ae27-ae3b3c5e13c4","html_url":"https://github.com/onionpancakes/hop","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/onionpancakes%2Fhop","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/onionpancakes%2Fhop/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/onionpancakes%2Fhop/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/onionpancakes%2Fhop/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/onionpancakes","download_url":"https://codeload.github.com/onionpancakes/hop/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248610407,"owners_count":21132920,"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":["client","http"],"created_at":"2024-11-06T02:40:50.671Z","updated_at":"2025-04-12T17:53:34.086Z","avatar_url":"https://github.com/onionpancakes.png","language":"Clojure","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Hop\n\nMinimal wrapper for Java's [HttpClient](https://docs.oracle.com/en/java/javase/21/docs/api/java.net.http/java/net/http/package-summary.html).\n\n# Status\n\n[![Run tests](https://github.com/onionpancakes/hop/actions/workflows/run_tests.yml/badge.svg)](https://github.com/onionpancakes/hop/actions/workflows/run_tests.yml)\n\nCurrently for my personal use. Future breaking changes possible.\n\n# Deps\n\nAdd to deps.edn\n\n```clojure\n{:deps\n  {dev.onionpancakes/hop\n    {:git/url   \"https://github.com/onionpancakes/hop\"\n     :git/sha   \"\u003cGIT SHA\u003e\"}}}\n```\n\n# Examples\n\n### GET\n\n```clojure\n(require '[dev.onionpancakes.hop.client :as hop])\n\n(hop/send \"http://www.example.com\")\n\n(hop/send {:uri \"http://www.example.com\"} :input-stream)\n```\n\n### POST\n\n```clojure\n(hop/send {:method :POST\n           :uri    \"http://www.example.com\"\n           :body   \"my post data\"})\n```\n\n\n# Usage\n\nRequire the namespace.\n\n```clojure\n(require '[dev.onionpancakes.hop.client :as hop])\n```\n\n## Send Requests\n\nSend some request.\n\n* First arg is a request map. Strings are accepted as shorthand as `{:uri \u003cstr value\u003e}`.\n* Second arg is a `BodyHandler`. When omitted, defaults to `:byte-array`.\n\n```clojure\n(def resp\n  (hop/send {:uri \"http://www.example.com\"}))\n```\n\nRead the response as a lookup map.\n\n```clojure\n(println (:status resp)) ; 200\n(println (:headers resp)) ; { some headers map value }\n(println (:body resp)) ; Default body data as byte-array\n(println (:media-type resp)) ; \"text/html\"\n(println (:character-encoding resp)) ; \"UTF-8\"\n(println (:content-type resp)) ; \"text/html; charset=UTF-8\"\n```\n\n## Set Accept-Encoding Manually\n\nSet accept-encoding manually.\n\n```clojure\n(def resp\n  (hop/send {:uri     \"http://www.example.com\"\n             :headers {:accept-encoding \"gzip\"}}))\n```\n\n### Decompress\n\n```clojure\n(require '[dev.onionpancakes.hop.io :as io])\n\n(slurp (io/decompress (:body resp) \"gzip\"))\n```\n\n# License\n\nReleased under the MIT License.","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fonionpancakes%2Fhop","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fonionpancakes%2Fhop","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fonionpancakes%2Fhop/lists"}