在线时间:8:00-16:00
迪恩网络APP
随时随地掌握行业动态
扫描二维码
关注迪恩网络微信公众号
开源软件名称:httprb/http开源软件地址:https://github.com/httprb/http开源编程语言:Ruby 100.0%开源软件介绍:AboutHTTP (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 Why http.rb?
InstallationAdd this line to your application's Gemfile: gem "http" And then execute: $ bundle Or install it yourself as: $ gem install http Inside of your Ruby program do: require "http" ...to pull it in as a dependency. DocumentationPlease see the http.rb wiki for more detailed documentation and usage notes. The following API documentation is also available: Basic UsageHere's some simple examples to get you started: >> 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.get("https://github.com")
=> #<HTTP::Response/1.1 200 OK {"Server"=>"GitHub.com", "Date"=>"Tue, 10 May...> We can also obtain an >> HTTP.get("https://github.com").body
=> #<HTTP::Response::Body:3ff756862b48 @streaming=false> The response body can be streamed with >> body = HTTP.get("https://github.com").body
=> #<HTTP::Response::Body:3ff756862b48 @streaming=false>
>> body.readpartial
=> "\n\n\n<!DOCTYPE html>\n<html lang=\"en\" class=\"\">\n <head prefix=\"o..."
>> body.readpartial
=> "\" href=\"/apple-touch-icon-72x72.png\">\n <link rel=\"apple-touch-ic..."
# ...
>> body.readpartial
=> nil Supported Ruby VersionsThis library aims to support and is tested against the following Ruby versions:
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
CopyrightCopyright © 2011-2022 Tony Arcieri, Alexey V. Zapparov, Erik Michaels-Ober, Zachary Anker. See LICENSE.txt for further details. |
2023-10-27
2022-08-15
2022-08-17
2022-09-23
2022-08-13
请发表评论