登录 注册
开发者工具
3,084
Stars
—
Forks
0
Watchers
—
Open Issues
待补全
许可证
Ruby
语言
—
创建时间
最近更新

项目能做什么

快速 Ruby HTTP 客户端(http.rb),支持链式 API、流式传输与超时控制。
来源:AI 基于仓库事实生成 · 内容以仓库实际 README 为准

使用说明 查看原始 README 原仓库文档

中文使用说明暂未生成。下面保留原仓库 README 摘录,命令与配置均以原文为准。
原始 README 摘录(英文原文,节选前 3000 字符)
# ![http.rb](https://raw.github.com/httprb/http.rb/main/logo.png)

[![Gem Version][gem-image]][gem-link]
[![MIT licensed][license-image]][license-link]
[![Docs][docs-image]][docs-link]
[![Lint][lint-image]][lint-link]
[![Mutant][mutant-image]][mutant-link]
[![Test][test-image]][test-link]
[![Typecheck][typecheck-image]][typecheck-link]
[![Duel](https://raw.githubusercontent.com/httprb/http/duel/badge/badge.svg)](https://github.com/sferik/duel-ruby)

[Documentation]

## About

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.


## Installation

Add this line to your application's Gemfile:
```ruby
gem "http"
```

And then execute:
```bash
$ bundle
```

Or install it yourself as:
```bash
$ gem install http
```

Inside of your Ruby program do:
```ruby
require "http"
```

...to pull it in as a dependency.


## Documentation

[Please see the http.rb wiki][documentation]
for more detailed documentation and usage notes.

The following API documentation is also available:

- [YARD API documentation](https://www.rubydoc.info/github/httprb/http)
- [Chainable module (all chainable methods)](https://www.rubydoc.info/github/httprb/http/HTTP/Chainable)


### Basic Usage

Here's some simple examples to get you started:

```ruby
>> HTTP.get("https://github.com").to_s
=> "\n\n\n<!DOCTYPE html>\n<html lang=\"en\" class=\"\">\n  <head prefix=\"o..."
```

That's all it takes! To obtain an `HTTP::Response` object instead of the response
body, all we have to do is omit the `#to_s` on the end:

```ruby
>> HTTP.get("https://github.com")
=> #<HTTP::Response/1.1 200 OK {"Server"=>"GitHub.com", "Date"=>"Tue, 10 May...>
```

We can also obtain an `HTTP::Response::Body` object for this response:

```ruby
>> HTTP.get("https://github.com").body
=> #<HTTP::Response::Body:3ff756862b48 @streaming=false>
```

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`:

```ruby
>> body = HTTP.get("https://github.com").body
=> #<HTTP::Response::Body:3ff756862b48 @streaming=false>
>> body.readpartial
阅读完整原文

项目深度分析 AI 生成

Ruby 出站 HTTP 流量可观测性与韧性治理插件(SaaS + Gem)

产品构想围绕 http.rb 提供开箱即用的插件/中间件,捕获出站 HTTP 调用的性能、错误率与下游 API 耗时,集成自动熔断、智能退避重试和下游 SLA 告警平台。
核心功能无侵入式 http.rb 中间件拦截器、下游依赖健康仪表盘、自动熔断与降级策略配置、出站请求全链路 Trace 注入。
目标用户中大型 Rails 应用团队、重度依赖第三方 SaaS API 的企业后端架构师。
难度/周期中等 · 2 - 3 个月 · 成本:月均服务器与测试开销约 300 - 800 元
收费模式免费开源基础 Gem + 云端监控仪表盘按每月出站事件量梯度订阅(Freemium SaaS)。
竞争风险现有 APM 工具(如 Datadog、New Relic)已有基础 HTTP 追踪,需在“深度的第三方依赖治理与主动熔断”上形成差异化。
依据 AI推测

高性能 Webhook/API 批量投递专用服务

产品构想基于 http.rb 的高性能底层流式与并发特性,构建轻量级高性能 Webhook 投递与重试微服务系统,解决企业大量异步通知被限流或阻塞的问题。
核心功能超高吞吐出站 HTTP 分发、可配置重试策略、签名校验工具箱、投递失败死信队列分析与重放界面。
目标用户SaaS 产品技术团队、支付/电商聚合平台开发者。
难度/周期中等 · 1.5 - 3 个月 · 成本:月均开发与多地域节点网络测试约 500 - 1500 元
收费模式按投递量收费的托管 SaaS,或提供单租户独立私有部署商业授权(License)。
竞争风险市场上有 Svix 等成熟竞品,作为独立开发者难以在泛用型市场上低成本获客。
依据 尚需验证的假设

商业数据采集与代理智能轮换集成扩展包

产品构想针对数据爬取场景,为 http.rb 定制防风控与代理路由插件包,并整合优质企业级代理 IP 资源,降低 Ruby 爬虫开发门槛。
核心功能http.rb 链式调用的代理池自动轮换插件、TLS/请求指纹伪装、自动重试与反反爬策略中间件、集成主流代理服务商 API。
目标用户Ruby 数据采集工程师、跨境电商分析师、商业情报收集团队。
难度/周期低 · 1 个月 · 成本:极低(主要为代理流量测试费用,约 200 - 500 元)
收费模式开源扩展包并通过代理商 API 分销返佣,或针对定制反爬中间件收取一次性商业授权费。
竞争风险Ruby 并非主流爬虫语言(主流为 Python/Go),目标客群基数相对较窄。
依据 数据支持的判断
AI 基于仓库公开数据分析生成,含推测成分,不构成收益承诺。
报告会保存到 个人中心

竞品与相似项目 GitHub Search 真实检索

相似项目数据正在完善中,暂不展示(避免误导)

项目优势与风险

技术成熟度创建时间待补全,最近推送 ,发布过 4 个 Release
社区活跃Star 3,084 / Fork 0 / Issue 0(数据支持,可自行核实)
许可证未检测到(需人工确认)
主要风险上游项目方向可能变化;同赛道竞争者较多(见竞品表);热度与需求不完全等价

安装与使用

此项目未提供 Docker 镜像,安装步骤以原仓库 README 为准(涉及依赖安装与环境配置,对新手门槛较高)。