title: How to capture RCurl verbose output
body: <p>I have the following request</p>
  
  <pre><code>library(RCurl)
  res=getURL("http://www.google.com/search?hl=en&amp;lr=&amp;ie=ISO-8859-1&amp;q=RCurl&amp;btnG=Search",
             .opts=list(verbose = TRUE)
             )
  </code></pre>
  
  <p>and would like to capture the verbose output of the call (i.e., what is printed in red in the R console). I thought that the output lines are messages and are therefore printed to <code>stderr()</code>. The following works for messages</p>
  
  <pre><code>sink(textConnection("test","w"),type="message")
  message("test message")
  sink(stderr(),type="message")
  test
  #[1] "test message"
  </code></pre>
  
  <p>but not if I replace <code>message("test message")</code> by the RCurl request <code>res=getURL(.....)</code> as given above.
  Obviously, RCurl's output is not printed to <code>stderr()</code>. It's also not printed to <code>stdout()</code>.</p>
  
  <p>So, how do I capture the output?</p>
  
  <p>Bonus question: Is <code>sink(stderr(),type="message")</code> the correct way of setting the connection back to R's default value?</p>
  
  <p>Thank you for your help!</p>