Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
e = Typhoeus::Easy.new
e.auth = {
:username => 'username',
:password => 'password',
:method => Typhoeus::Easy::AUTH_TYPES[:CURLAUTH_NTLM]
}
e.url = "http://example.com/auth_ntlm"
e.method = :get
e.perform
e = Typhoeus::Request.get("http://example.com",
:username => 'username',
:password => 'password',
:auth_method => :ntlm)
response = Typhoeus::Request.get("http://twitter.com/statuses/followers.json",
:username => username, :password => password)
Typhoeus::Request.new(“www.example.com”, :follow_location => true)
e = Typhoeus::Easy.new
e.url = "https://example.com/action"
s.ssl_cacert = "ca_file.cer"
e.ssl_cert = "acert.crt"
e.ssl_key = "akey.key"
[...]
e.perform
e = Typhoeus::Request.get("https://example.com/action",
:ssl_cacert => "ca_file.cer",
:ssl_cert => "acert.crt",
:ssl_key => "akey.key",
[...]
end
hydra = Typhoeus::Hydra.hydra
hydra.stub(:get, "http://localhost:3000/users")
response.timed_out?
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment