module Typhoeus::Request::Operations

def run

Returns:
  • (Response) - The response.

Other tags:
    Example: Run a request. -
def run
  easy = Typhoeus.get_easy
  begin
    easy.http_request(
      url,
      options.fetch(:method, :get),
      options.reject{|k,_| k==:method}
    )
  rescue Ethon::Errors::InvalidOption => e
    help = provide_help(e.message.match(/:\s(\w+)/)[1])
    raise $!, "#{$!}#{help}", $!.backtrace
  end
  easy.prepare
  easy.perform
  finish(Response.new(easy.to_hash))
  Typhoeus.release_easy(easy)
  response
end