You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
HTTP (The Gem! a.k.a. http.rb) is an easy-to-use client library for making requests
from Ruby. It uses a simple method chaining system for building requests, similar to
Python's Requests.
Under the hood, http.rb uses the llhttp parser, a fast HTTP parsing native extension.
This library isn't just yet another wrapper around Net::HTTP. It implements the HTTP
protocol natively and outsources the parsing to native extensions.
Why http.rb?
Clean API: http.rb offers an easy-to-use API that should be a
breath of fresh air after using something like Net::HTTP.
Maturity: http.rb is one of the most mature Ruby HTTP clients, supporting
features like persistent connections and fine-grained timeouts.
Performance: using native parsers and a clean, lightweight implementation,
http.rb achieves high performance while implementing HTTP in Ruby instead of C.
The response body can be streamed with HTTP::Response::Body#readpartial.
In practice, you'll want to bind the HTTP::Response::Body to a local variable
and call #readpartial on it repeatedly until it returns nil:
This library aims to support and is tested against
the following Ruby versions:
Ruby 3.0
Ruby 3.1
Ruby 3.2
Ruby 3.3
Ruby 3.4
JRuby 9.4
If something doesn't work on one of these versions, it's a bug.
This library may inadvertently work (or seem to work) on other Ruby versions,
however support will only be provided for the versions listed above.
If you would like this library to support another Ruby version or
implementation, you may volunteer to be a maintainer. Being a maintainer
entails making sure all tests run and pass on that implementation. When
something breaks on your implementation, you will be responsible for providing
patches in a timely fashion. If critical issues for a particular implementation
exist at the time of a major release, support for that Ruby version may be
dropped.
Contributing to http.rb
Fork http.rb on GitHub
Make your changes
Ensure all tests pass (bundle exec rake)
Send a pull request
If we like them we'll merge them
If we've accepted a patch, feel free to ask for commit access!