Skip to content

Instantly share code, notes, and snippets.

@LeifWarner
Created November 30, 2011 21:44
Show Gist options
  • Save LeifWarner/1411062 to your computer and use it in GitHub Desktop.
Save LeifWarner/1411062 to your computer and use it in GitHub Desktop.
Logging http requests
In the block passed to Curl::Easy:
e.g. {|curl|
curl.verbose = true
}
Logs headers only, not body.
import java.lang.System
System.setProperty("org.apache.commons.logging.Log", "org.apache.commons.logging.impl.SimpleLog")
System.setProperty("org.apache.commons.logging.simplelog.log.org.apache.http", "DEBUG")
Logs full requests/responses.
Other options available at:
http://hc.apache.org/httpcomponents-client-ga/logging.html
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment