::
- # Verbosity should now be configured with logging
- my_config = {'verbose': sys.stderr}
- requests.get('http://httpbin.org/headers', config=my_config) # bad!
+ import requests
+ import logging
+
+ # these two lines enable debugging at httplib level (requests->urllib3->httplib)
+ # you will see the REQUEST, including HEADERS and DATA, and RESPONSE with HEADERS but without DATA.
+ # the only thing missing will be the response.body which is not logged.
+ import httplib
+ httplib.HTTPConnection.debuglevel = 1
+
+ logging.basicConfig() # you need to initialize logging, otherwise you will not see anything from requests
+ logging.getLogger().setLevel(logging.DEBUG)
+ requests_log = logging.getLogger("requests")
+ requests_log.setLevel(logging.DEBUG)
+ requests_log.propagate = True
+
+ requests.get('http://httpbin.org/headers')
+
Licensing
package_dir={'requests': 'requests'},
include_package_data=True,
install_requires=requires,
+ setup_requires=['sphinx'],
license=open('LICENSE').read(),
zip_safe=False,
classifiers=(