QeweneyRuby HTTP 请求/响应 API
Qeweney 是一个功能丰富的 Ruby HTTP 请求/响应 API。
Qeweney 提供了统一的 API 来处理服务器端的 HTTP 请求和响应。Qeweney 定义了一个统一的适配器接口,允许处理传入的 HTTP 请求并通过任何协议或传输发送 HTTP 响应,无论是 HTTP/1、HTTP/2 还是 Rack 接口。
Qeweney 主要设计为与 Tipi一起使用,但也可以直接在 Rack 应用程序中使用,或驱动 Rack 应用程序。
特性:
- 适用于不同的 Web 服务器 API,尤其是 Tipi、Digital Fabric 和 Rack。
- Transport-agnostic
- 受 Roda 启发的高性能路由 API。
- 用于从 HTTP 请求中提取数据的丰富 API:表单解析、cookie、文件上传等。
- 用于构建 HTTP 响应的丰富 API:流响应、HTTP 升级、静态文件服务、延迟和 gzip 编码、缓存等。
- 适用于阻塞和非阻塞并发模型。
- 允许在读取和解析请求正文之前处理请求。
The Qeweney Adapter Interface
class AdapterInterface # Reads a chunk from the request body # @req [Qeweney::Request] request for which the chunk is to be read def get_body_chunk(req) end # Send a non-streaming response # @req [Qeweney::Request] request for which the response is sent # @body [String, nil] response body # @headers [Hash] response headers def respond(req, body, headers) end # Send only headers # @req [Qeweney::Request] request for which the response is sent # @headers [Hash] response headers # @empty_response [boolean] whether response is empty def send_headers(req, headers, empty_response: nil) end # Send a body chunk (this implies chunked transfer encoding) # @req [Qeweney::Request] request for which the response is sent # @body [String, nil] chunk # @done [boolean] whether response is finished def send_chunk(req, body, done: false) end # Finishes response # @req [Qeweney::Request] request for which the response is sent def finish(req) end end
评论
module-server处理 HTTP 请求
Moduleserver是一个为CommonJS模块提供web浏览器服务的系统工具。它的主要功能是支持逐步加载模块,每加载一次模块响应1次HTTP请求。 Moduleserver有以下限制:请求模块正
module-server处理 HTTP 请求
0
java代理http请求
前言估计看到这个标题你会觉得多此一举,因为nginx完全可以实现代理,且配置非常方便。之前接到一个需求,服务器必须使用java程序进行代理,并记录详细的出入参,以便后续根据日志查到问题。先暂且不纠结是否必要,...
林中微光
0
Requests-GoGo 的 HTTP 请求库
Requests-Go,一个类似于PythonRequests的Go语言HTTP请求库。安装go get github.com/solos/requests用法package mainimport r
Requests-GoGo 的 HTTP 请求库
0