Skip to content

Instantly share code, notes, and snippets.

@hanshasselberg
Created June 21, 2012 12:18
Show Gist options
  • Save hanshasselberg/2965445 to your computer and use it in GitHub Desktop.
Save hanshasselberg/2965445 to your computer and use it in GitHub Desktop.
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