{"id":15694197,"url":"https://github.com/scrogson/revolver","last_synced_at":"2025-05-08T07:29:18.684Z","repository":{"id":31302417,"uuid":"34864644","full_name":"scrogson/revolver","owner":"scrogson","description":"An Elixir HTTP Client inspired by Plug and Ecto","archived":false,"fork":false,"pushed_at":"2017-02-12T06:11:17.000Z","size":25,"stargazers_count":7,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-05-03T08:28:06.418Z","etag":null,"topics":["composable","elixir","http"],"latest_commit_sha":null,"homepage":"","language":"Elixir","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/scrogson.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}},"created_at":"2015-04-30T16:27:02.000Z","updated_at":"2017-04-02T11:18:46.000Z","dependencies_parsed_at":"2022-08-26T07:01:52.372Z","dependency_job_id":null,"html_url":"https://github.com/scrogson/revolver","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/scrogson%2Frevolver","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/scrogson%2Frevolver/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/scrogson%2Frevolver/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/scrogson%2Frevolver/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/scrogson","download_url":"https://codeload.github.com/scrogson/revolver/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":253020336,"owners_count":21841539,"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":["composable","elixir","http"],"created_at":"2024-10-03T18:54:11.864Z","updated_at":"2025-05-08T07:29:18.664Z","avatar_url":"https://github.com/scrogson.png","language":"Elixir","funding_links":[],"categories":[],"sub_categories":[],"readme":"Revolver\n========\n\nAn Elixir HTTP Client inspired by [Plug] and [Ecto].\n\n\u003e **WARNING:** This library is under early development. The API may change\n\u003e frequently until it reaches 1.0.\n\nThe library is currently an experiment. The goal is to create something that is\nvery composeable, like [Plug]. It will provide adapters for different Erlang\nHTTP clients.\n\n## Desired API (?)\n\n```elixir\ndefmodule GitHub do\n  use Revolver.Client, otp_app: :github\nend\n\ndefmodule GitHub.Repos do\n  import GitHub\n  import Revolver.Conn\n\n  @doc \"\"\"\n  Fetches a list of repos for the give username.\n  \"\"\"\n  def list!(user) do\n    conn()\n    |\u003e get!(\"/users/#{user}/repos\")\n  end\n\n  @doc \"\"\"\n  Create a repo for the current user (based on OAuth token)\n  \"\"\"\n  def create!(token, params \\\\ %{}) do\n    params = Map.take(params, ~w(name description homepage private has_issues\n                                 has_wiki has_downloads team_id auto_init\n                                 gitignore_template license_template)a)\n    conn()\n    |\u003e put_req_body(params)\n    |\u003e put_req_header(\"authorization\", \"Bearer \" \u003c\u003e token)\n    |\u003e post!(\"/user/repos\")\n  end\nend\n\n# config/config.exs\nconfig :github, GitHub,\n  adapter: Revolver.Adapters.Hackney,\n  host: \"https://api.github.com\",\n  headers: [\n    {\"accept\", \"application/vnd.github.v3+json\"},\n    {\"content-type\", \"application/json\"}\n  ]\n\n# Configure serializers for automatic encoding/decoding request/response bodies\nconfig :revolver,\n  serializers: %{\n    \"application/json\" =\u003e Poison,\n    \"application/vnd.github.v3+json\" =\u003e Poison\n  }\n\nconn = GitHub.Repos.list!(\"scrogson\")\n\nIO.inspect conn\n#=\u003e %Revolver.Conn{host: \"api.github.com\", port: 443, scheme: :https, ...}\n\nconn.resp_body\n#=\u003e [%{...}, %{...}]\n```\n\n## LICENSE\n\nSee [LICENSE]\n\n[Plug]: https://github.com/elixir-lang/plug\n[Ecto]: https://github.com/elixir-ecto/ecto\n[LICENSE]: https://github.com/scrogson/revolver/blob/master/LICENSE\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fscrogson%2Frevolver","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fscrogson%2Frevolver","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fscrogson%2Frevolver/lists"}