Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

httpi

Package Overview
Dependencies
Maintainers
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

httpi

  • 4.0.4
  • Rubygems
  • Socket score

Version published
Maintainers
2
Created
Source

HTTPI

A common interface for Ruby's HTTP libraries. This project is now in maintenance mode. For new projects, we recommend faraday.

Documentation

Development

Installation

HTTPI is available through Rubygems and can be installed via:

$ gem install httpi

or add it to your Gemfile like this:

gem 'httpi', '~> 4.0.0'

Usage example

require "httpi"

# create a request object
request = HTTPI::Request.new
request.url = "http://example.com"

# and pass it to a request method
HTTPI.get(request)

# use a specific adapter per request
HTTPI.get(request, :curb)

# or specify a global adapter to use
HTTPI.adapter = :httpclient

# and execute arbitary requests
HTTPI.request(:custom, request)

# add a client setup block that will be called before each request
HTTPI.adapter = :httpclient
HTTPI.adapter_client_setup = proc do |x|
  x.ssl_config.set_default_paths
  x.force_basic_auth = true
end
# ...
HTTPI.get(request) do |x|
  x.force_basic_auth = false
end

SOCKS Proxy Support

To use the the SOCKS proxy support, please add the socksify gem to your gemfile, and add the following code:

require 'socksify'
require 'socksify/http'

to your project.

Documentation

Continue reading at https://www.rubydoc.info/gems/httpi

FAQs

Package last updated on 14 Jul 2024

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc