Module Typhoeus
In: lib/typhoeus.rb
lib/typhoeus/config.rb
lib/typhoeus/hydra.rb
lib/typhoeus/easy_factory.rb
lib/typhoeus/errors.rb
lib/typhoeus/pool.rb
lib/typhoeus/response.rb
lib/typhoeus/expectation.rb
lib/typhoeus/response/header.rb
lib/typhoeus/response/status.rb
lib/typhoeus/response/informations.rb
lib/typhoeus/response/cacheable.rb
lib/typhoeus/request.rb
lib/typhoeus/hydra/queueable.rb
lib/typhoeus/hydra/runnable.rb
lib/typhoeus/hydra/stubbable.rb
lib/typhoeus/hydra/before.rb
lib/typhoeus/hydra/memoizable.rb
lib/typhoeus/hydra/addable.rb
lib/typhoeus/hydra/block_connection.rb
lib/typhoeus/hydra/cacheable.rb
lib/typhoeus/request/actions.rb
lib/typhoeus/request/stubbable.rb
lib/typhoeus/request/before.rb
lib/typhoeus/request/callbacks.rb
lib/typhoeus/request/memoizable.rb
lib/typhoeus/request/streamable.rb
lib/typhoeus/request/operations.rb
lib/typhoeus/request/marshal.rb
lib/typhoeus/request/responseable.rb
lib/typhoeus/request/block_connection.rb
lib/typhoeus/request/cacheable.rb
lib/typhoeus/errors/no_stub.rb
lib/typhoeus/errors/typhoeus_error.rb
lib/typhoeus/version.rb

Typhoeus is a HTTP client library based on Ethon which wraps libcurl. Sitting on top of libcurl makes Typhoeus very reliable and fast.

There are some gems using Typhoeus like {github.com/myronmarston/vcr VCR}, {github.com/bblimke/webmock WebMock} or {github.com/technoweenie/faraday Faraday}. VCR and WebMock provide their own adapter whereas Faraday relies on {Faraday::Adapter::Typhoeus} since Typhoeus version 0.5.

@example (see Typhoeus::Request) @example (see Typhoeus::Hydra)

@see Typhoeus::Request @see Typhoeus::Hydra @see Faraday::Adapter::Typhoeus

@since 0.5.0

Methods

Classes and Modules

Module Typhoeus::Config
Module Typhoeus::Errors
Module Typhoeus::Pool
Class Typhoeus::EasyFactory
Class Typhoeus::Expectation
Class Typhoeus::Hydra
Class Typhoeus::Request
Class Typhoeus::Response

Constants

USER_AGENT = "Typhoeus - https://github.com/typhoeus/typhoeus"   The default Typhoeus user agent.
VERSION = '0.8.0'   The current Typhoeus version.

Public Class methods

Add before callbacks.

@example Add before callback.

  Typhoeus.before { |request| p request.base_url }

@param [ Block ] block The callback.

@yield [ Typhoeus::Request ]

@return [ Array<Block> ] All before blocks.

Set the Typhoeus configuration options by passing a block.

@example (see Typhoeus::Config)

@yield [ Typhoeus::Config ]

@return [ Typhoeus::Config ] The configuration.

@see Typhoeus::Config

Stub out a specific request.

@example (see Typhoeus::Expectation)

@param [ String ] base_url The url to stub out. @param [ Hash ] options The options to stub out.

@return [ Typhoeus::Expectation ] The expecatation.

@see Typhoeus::Expectation

Execute given block as if block connection is turned off. The old block connection state is restored afterwards.

@example Make a real request, no matter if it‘s blocked.

  Typhoeus::Config.block_connection = true
  Typhoeus.get("www.example.com").code
  #=> raise Typhoeus::Errors::NoStub

  Typhoeus.with_connection do
    Typhoeus.get("www.example.com").code
    #=> :ok
  end

@param [ Block ] block The block to execute.

@return [ Object ] Returns the return value of the block.

@see Typhoeus::Config#block_connection

[Validate]