Skip to content

Instantly share code, notes, and snippets.

@i0rek
Created Feb 15, 2013
Embed
What would you like to do?
> require 'typhoeus'
#=> true
> Typhoeus::Config.verbose = true
> Typhoeus.get("www.example.com")
* About to connect() to www.example.com port 80 (#0)
* Trying 2001:500:88:200::10...
* Failed to connect to 2001:500:88:200::10: No route to host
* Undefined error: 0
* Trying 192.0.43.10...
* connected
* Connected to www.example.com (192.0.43.10) port 80 (#0)
> GET / HTTP/1.1
Host: www.example.com
Accept: */*
User-Agent: Typhoeus - https://github.com/typhoeus/typhoeus
* HTTP 1.0, assume close after body
< HTTP/1.0 302 Found
< Location: http://www.iana.org/domains/example/
< Server: BigIP
* HTTP/1.0 connection set to keep alive!
< Connection: Keep-Alive
< Content-Length: 0
<
* Connection #0 to host www.example.com left intact
#=> #<Typhoeus::Response>
irb(main):005:0> Typhoeus.get("www.example.com")
* Re-using existing connection! (#0) with host www.example.com
* Connected to www.example.com (192.0.43.10) port 80 (#0)
> GET / HTTP/1.0
Host: www.example.com
Accept: */*
User-Agent: Typhoeus - https://github.com/typhoeus/typhoeus
* HTTP 1.0, assume close after body
< HTTP/1.0 302 Found
< Location: http://www.iana.org/domains/example/
< Server: BigIP
< Connection: close
< Content-Length: 0
<
* Closing connection #0
#=> #<Typhoeus::Response>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment