[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"project-7880":3},{"id":4,"name":5,"fullName":6,"owner":7,"repo":5,"description":8,"homepage":9,"htmlUrl":10,"language":11,"languages":10,"totalLinesOfCode":10,"stars":12,"forks":13,"watchers":14,"openIssues":15,"contributorsCount":16,"subscribersCount":16,"size":16,"stars1d":16,"stars7d":16,"stars30d":17,"stars90d":16,"forks30d":16,"starsTrendScore":16,"compositeScore":18,"rankGlobal":10,"rankLanguage":10,"license":19,"archived":20,"fork":20,"defaultBranch":21,"hasWiki":22,"hasPages":20,"topics":23,"createdAt":10,"pushedAt":10,"updatedAt":27,"readmeContent":28,"aiSummary":29,"trendingCount":16,"starSnapshotCount":16,"syncStatus":30,"lastSyncTime":31,"discoverSource":32},7880,"http","httprb\u002Fhttp","httprb","HTTP (The Gem! a.k.a. http.rb) - a fast Ruby HTTP client with a chainable API, streaming support, and timeouts","",null,"Ruby",3086,324,42,23,0,12,29.54,"MIT License",false,"main",true,[24,5,25,26],"client","http-client","ruby","2026-06-12 02:01:45","# ![http.rb](https:\u002F\u002Fraw.github.com\u002Fhttprb\u002Fhttp.rb\u002Fmain\u002Flogo.png)\n\n[![Gem Version][gem-image]][gem-link]\n[![MIT licensed][license-image]][license-link]\n[![Docs][docs-image]][docs-link]\n[![Lint][lint-image]][lint-link]\n[![Mutant][mutant-image]][mutant-link]\n[![Test][test-image]][test-link]\n[![Typecheck][typecheck-image]][typecheck-link]\n\n[Documentation]\n\n## About\n\nHTTP (The Gem! a.k.a. http.rb) is an easy-to-use client library for making requests\nfrom Ruby. It uses a simple method chaining system for building requests, similar to\nPython's [Requests].\n\nUnder the hood, http.rb uses the [llhttp] parser, a fast HTTP parsing native extension.\nThis library isn't just yet another wrapper around `Net::HTTP`. It implements the HTTP\nprotocol natively and outsources the parsing to native extensions.\n\n### Why http.rb?\n\n- **Clean API**: http.rb offers an easy-to-use API that should be a\n   breath of fresh air after using something like Net::HTTP.\n\n- **Maturity**: http.rb is one of the most mature Ruby HTTP clients, supporting\n   features like persistent connections and fine-grained timeouts.\n\n- **Performance**: using native parsers and a clean, lightweight implementation,\n   http.rb achieves high performance while implementing HTTP in Ruby instead of C.\n\n\n## Installation\n\nAdd this line to your application's Gemfile:\n```ruby\ngem \"http\"\n```\n\nAnd then execute:\n```bash\n$ bundle\n```\n\nOr install it yourself as:\n```bash\n$ gem install http\n```\n\nInside of your Ruby program do:\n```ruby\nrequire \"http\"\n```\n\n...to pull it in as a dependency.\n\n\n## Documentation\n\n[Please see the http.rb wiki][documentation]\nfor more detailed documentation and usage notes.\n\nThe following API documentation is also available:\n\n- [YARD API documentation](https:\u002F\u002Fwww.rubydoc.info\u002Fgithub\u002Fhttprb\u002Fhttp)\n- [Chainable module (all chainable methods)](https:\u002F\u002Fwww.rubydoc.info\u002Fgithub\u002Fhttprb\u002Fhttp\u002FHTTP\u002FChainable)\n\n\n### Basic Usage\n\nHere's some simple examples to get you started:\n\n```ruby\n>> HTTP.get(\"https:\u002F\u002Fgithub.com\").to_s\n=> \"\\n\\n\\n\u003C!DOCTYPE html>\\n\u003Chtml lang=\\\"en\\\" class=\\\"\\\">\\n  \u003Chead prefix=\\\"o...\"\n```\n\nThat's all it takes! To obtain an `HTTP::Response` object instead of the response\nbody, all we have to do is omit the `#to_s` on the end:\n\n```ruby\n>> HTTP.get(\"https:\u002F\u002Fgithub.com\")\n=> #\u003CHTTP::Response\u002F1.1 200 OK {\"Server\"=>\"GitHub.com\", \"Date\"=>\"Tue, 10 May...>\n```\n\nWe can also obtain an `HTTP::Response::Body` object for this response:\n\n```ruby\n>> HTTP.get(\"https:\u002F\u002Fgithub.com\").body\n=> #\u003CHTTP::Response::Body:3ff756862b48 @streaming=false>\n```\n\nThe response body can be streamed with `HTTP::Response::Body#readpartial`.\nIn practice, you'll want to bind the `HTTP::Response::Body` to a local variable\nand call `#readpartial` on it repeatedly until it returns `nil`:\n\n```ruby\n>> body = HTTP.get(\"https:\u002F\u002Fgithub.com\").body\n=> #\u003CHTTP::Response::Body:3ff756862b48 @streaming=false>\n>> body.readpartial\n=> \"\\n\\n\\n\u003C!DOCTYPE html>\\n\u003Chtml lang=\\\"en\\\" class=\\\"\\\">\\n  \u003Chead prefix=\\\"o...\"\n>> body.readpartial\n=> \"\\\" href=\\\"\u002Fapple-touch-icon-72x72.png\\\">\\n    \u003Clink rel=\\\"apple-touch-ic...\"\n# ...\n>> body.readpartial\n=> nil\n```\n\n### Pattern Matching\n\nResponse objects support Ruby's pattern matching:\n\n```ruby\ncase HTTP.get(\"https:\u002F\u002Fapi.example.com\u002Fusers\")\nin { status: 200..299, body: body }\n  JSON.parse(body.to_s)\nin { status: 404 }\n  nil\nin { status: 400.. }\n  raise \"request failed\"\nend\n```\n\nPattern matching is also supported on `HTTP::Response::Status`, `HTTP::Headers`,\n`HTTP::ContentType`, and `HTTP::URI`.\n\n### Base URI\n\nSet a base URI to avoid repeating the scheme and host in every request:\n\n```ruby\napi = HTTP.base_uri(\"https:\u002F\u002Fapi.example.com\u002Fv1\")\napi.get(\"users\")       # GET https:\u002F\u002Fapi.example.com\u002Fv1\u002Fusers\napi.get(\"users\u002F1\")     # GET https:\u002F\u002Fapi.example.com\u002Fv1\u002Fusers\u002F1\n```\n\nRelative paths are resolved per [RFC 3986](https:\u002F\u002Fwww.rfc-editor.org\u002Frfc\u002Frfc3986#section-5).\nCombine with `persistent` to reuse the connection:\n\n```ruby\nHTTP.base_uri(\"https:\u002F\u002Fapi.example.com\u002Fv1\").persistent do |http|\n  http.get(\"users\")\n  http.get(\"posts\")\nend\n```\n\n### Thread Safety\n\nConfigured sessions are safe to share across threads:\n\n```ruby\n# Build a session once, use it from any thread\nsession = HTTP.headers(\"Accept\" => \"application\u002Fjson\")\n              .timeout(10)\n              .auth(\"Bearer token\")\n\nthreads = 10.times.map do\n  Thread.new { session.get(\"https:\u002F\u002Fexample.com\u002Fapi\u002Fdata\") }\nend\nthreads.each(&:join)\n```\n\nChainable configuration methods (`.headers`, `.timeout`, `.auth`, etc.) return\nan `HTTP::Session`, which creates a fresh `HTTP::Client` for every request.\n\nPersistent connections (`HTTP.persistent`) return an `HTTP::Session` that pools\none `HTTP::Client` per origin. The session itself is **not** thread-safe. For\nthread-safe persistent connections, use the\n[connection_pool](https:\u002F\u002Frubygems.org\u002Fgems\u002Fconnection_pool) gem:\n\n```ruby\npool = ConnectionPool.new(size: 5) { HTTP.persistent(\"https:\u002F\u002Fexample.com\") }\npool.with { |http| http.get(\"\u002Fpath\") }\n```\n\nCross-origin redirects are handled transparently — the session opens a separate\npersistent connection for each origin encountered during a redirect chain:\n\n```ruby\nHTTP.persistent(\"https:\u002F\u002Fexample.com\").follow do |http|\n  http.get(\"\u002Fmoved-to-other-domain\")  # follows redirect across origins\nend\n```\n\n## Supported Ruby Versions\n\nThis library aims to support and is [tested against][build-link]\nthe following Ruby  versions:\n\n- Ruby 3.2\n- Ruby 3.3\n- Ruby 3.4\n- Ruby 4.0\n\nIf something doesn't work on one of these versions, it's a bug.\n\nThis library may inadvertently work (or seem to work) on other Ruby versions,\nhowever support will only be provided for the versions listed above.\n\nIf you would like this library to support another Ruby version or\nimplementation, you may volunteer to be a maintainer. Being a maintainer\nentails making sure all tests run and pass on that implementation. When\nsomething breaks on your implementation, you will be responsible for providing\npatches in a timely fashion. If critical issues for a particular implementation\nexist at the time of a major release, support for that Ruby version may be\ndropped.\n\n\n## Upgrading\n\nSee [UPGRADING.md] for a detailed migration guide between major versions.\n\n\n## Security\n\nSee [SECURITY.md] for reporting vulnerabilities.\n\n\n## Contributing to http.rb\n\nSee [CONTRIBUTING.md] for guidelines, or the quick version:\n\n- Fork http.rb on GitHub\n- Make your changes\n- Ensure all tests pass (`bundle exec rake`)\n- Send a pull request\n- If we like them we'll merge them\n- If we've accepted a patch, feel free to ask for commit access!\n\n\n## Copyright\n\nCopyright © 2011-2026 Tony Arcieri, Erik Berlin, Alexey V. Zapparov, Zachary Anker.\nSee LICENSE.txt for further details.\n\n\n[\u002F\u002F]: # (badges)\n\n[gem-image]: https:\u002F\u002Fimg.shields.io\u002Fgem\u002Fv\u002Fhttp?logo=ruby\n[gem-link]: https:\u002F\u002Frubygems.org\u002Fgems\u002Fhttp\n[license-image]: https:\u002F\u002Fimg.shields.io\u002Fbadge\u002Flicense-MIT-blue.svg\n[license-link]: https:\u002F\u002Fgithub.com\u002Fhttprb\u002Fhttp\u002Fblob\u002Fmain\u002FLICENSE.txt\n[docs-image]: https:\u002F\u002Fgithub.com\u002Fhttprb\u002Fhttp\u002Factions\u002Fworkflows\u002Fdocs.yml\u002Fbadge.svg\n[docs-link]: https:\u002F\u002Fgithub.com\u002Fhttprb\u002Fhttp\u002Factions\u002Fworkflows\u002Fdocs.yml\n[lint-image]: https:\u002F\u002Fgithub.com\u002Fhttprb\u002Fhttp\u002Factions\u002Fworkflows\u002Flint.yml\u002Fbadge.svg\n[lint-link]: https:\u002F\u002Fgithub.com\u002Fhttprb\u002Fhttp\u002Factions\u002Fworkflows\u002Flint.yml\n[mutant-image]: https:\u002F\u002Fgithub.com\u002Fhttprb\u002Fhttp\u002Factions\u002Fworkflows\u002Fmutant.yml\u002Fbadge.svg\n[mutant-link]: https:\u002F\u002Fgithub.com\u002Fhttprb\u002Fhttp\u002Factions\u002Fworkflows\u002Fmutant.yml\n[test-image]: https:\u002F\u002Fgithub.com\u002Fhttprb\u002Fhttp\u002Factions\u002Fworkflows\u002Ftest.yml\u002Fbadge.svg\n[test-link]: https:\u002F\u002Fgithub.com\u002Fhttprb\u002Fhttp\u002Factions\u002Fworkflows\u002Ftest.yml\n[typecheck-image]: https:\u002F\u002Fgithub.com\u002Fhttprb\u002Fhttp\u002Factions\u002Fworkflows\u002Ftypecheck.yml\u002Fbadge.svg\n[typecheck-link]: https:\u002F\u002Fgithub.com\u002Fhttprb\u002Fhttp\u002Factions\u002Fworkflows\u002Ftypecheck.yml\n\n[\u002F\u002F]: # (links)\n\n[contributing.md]: https:\u002F\u002Fgithub.com\u002Fhttprb\u002Fhttp\u002Fblob\u002Fmain\u002FCONTRIBUTING.md\n[documentation]: https:\u002F\u002Fgithub.com\u002Fhttprb\u002Fhttp\u002Fwiki\n[llhttp]: https:\u002F\u002Fllhttp.org\u002F\n[requests]: https:\u002F\u002Fdocs.python-requests.org\u002Fen\u002Flatest\u002F\n[security.md]: https:\u002F\u002Fgithub.com\u002Fhttprb\u002Fhttp\u002Fblob\u002Fmain\u002FSECURITY.md\n[upgrading.md]: https:\u002F\u002Fgithub.com\u002Fhttprb\u002Fhttp\u002Fblob\u002Fmain\u002FUPGRADING.md\n","http.rb 是一个快速且易于使用的 Ruby HTTP 客户端库，支持链式 API、流式传输和超时设置。该项目采用简洁的 API 设计，使得构建请求变得简单直观，并利用 llhttp 解析器这一高性能的原生扩展来处理 HTTP 协议解析任务，从而在保持轻量级实现的同时达到了较高的性能表现。http.rb 支持持久连接等高级功能，适用于需要高效、稳定地进行网络请求的应用场景中，如 Web 服务开发、API 调用等。",2,"2026-06-11 03:14:53","top_language"]