Created
June 21, 2012 12:18
-
-
Save hanshasselberg/2965445 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
e = Typhoeus::Request.get("http://example.com", | |
:username => 'username', | |
:password => 'password', | |
:auth_method => :ntlm) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
response = Typhoeus::Request.get("http://twitter.com/statuses/followers.json", | |
:username => username, :password => password) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Typhoeus::Request.new(“www.example.com”, :follow_location => true) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
e = Typhoeus::Request.get("https://example.com/action", | |
:ssl_cacert => "ca_file.cer", | |
:ssl_cert => "acert.crt", | |
:ssl_key => "akey.key", | |
[...] | |
end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
hydra = Typhoeus::Hydra.hydra | |
hydra.stub(:get, "http://localhost:3000/users") |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
response.timed_out? |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment