Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>If you're using <code>Net::HTTP</code>, use <code>#set_debug_output</code>:</p> <pre><code>1.9.3p194 :017 &gt; http = Net::HTTP.new('google.com') =&gt; #&lt;Net::HTTP google.com:80 open=false&gt; 1.9.3p194 :018 &gt; http.request_get('/') =&gt; #&lt;Net::HTTPMovedPermanently 301 Moved Permanently readbody=true&gt; 1.9.3p194 :019 &gt; http.set_debug_output($stdout) =&gt; #&lt;IO:&lt;STDOUT&gt;&gt; 1.9.3p194 :020 &gt; http.request_get('/') opening connection to google.com... opened &lt;- "GET / HTTP/1.1\r\nAccept: */*\r\nUser-Agent: Ruby\r\nConnection: close\r\nHost: google.com\r\n\r\n" -&gt; "HTTP/1.1 301 Moved Permanently\r\n" -&gt; "Location: http://www.google.com/\r\n" -&gt; "Content-Type: text/html; charset=UTF-8\r\n" -&gt; "Date: Mon, 23 Jul 2012 21:41:13 GMT\r\n" -&gt; "Expires: Wed, 22 Aug 2012 21:41:13 GMT\r\n" -&gt; "Cache-Control: public, max-age=2592000\r\n" -&gt; "Server: gws\r\n" -&gt; "Content-Length: 219\r\n" -&gt; "X-XSS-Protection: 1; mode=block\r\n" -&gt; "X-Frame-Options: SAMEORIGIN\r\n" -&gt; "Connection: close\r\n" -&gt; "\r\n" reading 219 bytes... -&gt; "&lt;HTML&gt;&lt;HEAD&gt;&lt;meta http-equiv=\"content-type\" content=\"text/html;charset=utf-8\"&gt;\n&lt;TITLE&gt;301 Moved&lt;/TITLE&gt;&lt;/HEAD&gt;&lt;BODY&gt;\n&lt;H1&gt;301 Moved&lt;/H1&gt;\nThe document has moved\n&lt;A HREF=\"http://www.google.com/\"&gt;here&lt;/A&gt;.\r\n&lt;/BODY&gt;&lt;/HTML&gt;\r\n" read 219 bytes Conn close =&gt; #&lt;Net::HTTPMovedPermanently 301 Moved Permanently readbody=true&gt; </code></pre> <p>Or with <code>HTTParty</code>, use the <code>:debug_output</code> option:</p> <pre><code>1.9.3p194 :028 &gt; HTTParty.get('http://www.google.com', :debug_output =&gt; $stdout) opening connection to www.google.com... opened &lt;- "GET / HTTP/1.1\r\nConnection: close\r\nHost: www.google.com\r\n\r\n" -&gt; "HTTP/1.1 200 OK\r\n" -&gt; "Date: Mon, 23 Jul 2012 21:42:55 GMT\r\n" -&gt; "Expires: -1\r\n" -&gt; "Cache-Control: private, max-age=0\r\n" -&gt; "Content-Type: text/html; charset=ISO-8859-1\r\n" -&gt; "Set-Cookie: expires=; expires=Mon, 01-Jan-1990 00:00:00 GMT; path=/; domain=www.google.com\r\n" -&gt; "Set-Cookie: path=; expires=Mon, 01-Jan-1990 00:00:00 GMT; path=/; domain=www.google.com\r\n" -&gt; "Set-Cookie: domain=; expires=Mon, 01-Jan-1990 00:00:00 GMT; path=/; domain=www.google.com\r\n" -&gt; "Set-Cookie: expires=; expires=Mon, 01-Jan-1990 00:00:00 GMT; path=/; domain=.www.google.com\r\n" -&gt; "Set-Cookie: path=; expires=Mon, 01-Jan-1990 00:00:00 GMT; path=/; domain=.www.google.com\r\n" -&gt; "Set-Cookie: domain=; expires=Mon, 01-Jan-1990 00:00:00 GMT; path=/; domain=.www.google.com\r\n" -&gt; "Set-Cookie: expires=; expires=Mon, 01-Jan-1990 00:00:00 GMT; path=/; domain=google.com\r\n" -&gt; "Set-Cookie: path=; expires=Mon, 01-Jan-1990 00:00:00 GMT; path=/; domain=google.com\r\n" -&gt; "Set-Cookie: domain=; expires=Mon, 01-Jan-1990 00:00:00 GMT; path=/; domain=google.com\r\n" -&gt; "Set-Cookie: expires=; expires=Mon, 01-Jan-1990 00:00:00 GMT; path=/; domain=.google.com\r\n" -&gt; "Set-Cookie: path=; expires=Mon, 01-Jan-1990 00:00:00 GMT; path=/; domain=.google.com\r\n" -&gt; "Set-Cookie: domain=; expires=Mon, 01-Jan-1990 00:00:00 GMT; path=/; domain=.google.com\r\n" -&gt; "Set-Cookie: PREF=ID=bf7ea711fb78b88f:FF=0:TM=1343079775:LM=1343079775:S=sitzmIr74uTXkzTt; expires=Wed, 23-Jul-2014 21:42:55 GMT; path=/; domain=.google.com\r\n" -&gt; "Set-Cookie: NID=62=i-gpt9kPmB80W787ganAdeSSc502sPHOT5bwpddGHTbVtAB5-oDjjaJtQAN7znbEk70RkuHDui5sJOlZrXB0MzfIKtpU2x7vRDj3vFQch6BRcqQaVmzm_J7OzAIOpB5H; expires=Tue, 22-Jan-2013 21:42:55 GMT; path=/; domain=.google.com; HttpOnly\r\n" -&gt; "P3P: CP=\"This is not a P3P policy! See http://www.google.com/support/accounts/bin/answer.py?hl=en&amp;answer=151657 for more info.\"\r\n" -&gt; "Server: gws\r\n" -&gt; "X-XSS-Protection: 1; mode=block\r\n" -&gt; "X-Frame-Options: SAMEORIGIN\r\n" -&gt; "Connection: close\r\n" -&gt; "\r\n" reading all... # ... snip ... </code></pre> <p>At this point, you can copy that output, or you can replace <code>$stdout</code> with any <code>IO</code> instance, like a <code>File</code>:</p> <pre><code>1.9.3p194 :034 &gt; File.open('/tmp/http.out', 'w') {|f| http.set_debug_output(f); http.get('/')} =&gt; #&lt;Net::HTTPMovedPermanently 301 Moved Permanently readbody=true&gt; 1.9.3p194 :035 &gt; File.read('/tmp/http.out') =&gt; "opening connection to google.com...\nopened\n&lt;- "GET / HTTP/1.1\\r\\nAccept-Encoding: gzip;q=1.0,deflate;q=0.6,identity;q=0.3\\r\\nAccept: */*\\r\\nUser-Agent: Ruby\\r\\nConnection: close\\r\\nHost: google.com\\r\\n\\r\\n"\n-&gt; "HTTP/1.1 301 Moved Permanently\\r\\n"\n-&gt; "Location: http://www.google.com/\\r\\n"\n-&gt; "Content-Type: text/html; charset=UTF-8\\r\\n"\n-&gt; "Date: Mon, 23 Jul 2012 21:46:02 GMT\\r\\n"\n-&gt; "Expires: Wed, 22 Aug 2012 21:46:02 GMT\\r\\n"\n-&gt; "Cache-Control: public, max-age=2592000\\r\\n"\n-&gt; "Server: gws\\r\\n"\n-&gt; "Content-Length: 219\\r\\n"\n-&gt; "X-XSS-Protection: 1; mode=block\\r\\n"\n-&gt; "X-Frame-Options: SAMEORIGIN\\r\\n"\n-&gt; "Connection: close\\r\\n"\n-&gt; "\\r\\n"\nreading 219 bytes...\n-&gt; "&lt;HTML&gt;&lt;HEAD&gt;&lt;meta http-equiv=\\"content-type\\" content=\\"text/html;charset=utf-8\\"&gt;\\n&lt;TITLE&gt;301 Moved&lt;/TITLE&gt;&lt;/HEAD&gt;&lt;BODY&gt;\\n&lt;H1&gt;301 Moved&lt;/H1&gt;\\nThe document has moved\\n&lt;A HREF=\\"http://www.google.com/\\"&gt;here&lt;/A&gt;.\\r\\n&lt;/BODY&gt;&lt;/HTML&gt;\\r\\n"\nread 219 bytes\nConn close\n" </code></pre>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload