Skip to main content
This is a pre-production deployment of Warehouse. Changes made here affect the production instance of PyPI (
Help us improve Python packaging - Donate today!

Simple wrapper around the requets library

Project Description

Logged Requests

logged_requests is a simple wrapper around the requests.Session object. It captures input and output data of a requests.Session object.


pip install logged_requests


>>> url = ''
>>> from logged_requests import LoggedRequests
>>> req = LoggedRequests()
>>> resp =, json={"name":"jsoh"})
2016-04-12 21:09:56 INFO logged_requests.logged_requests.request: POST
2016-04-12 21:09:57 DEBUG logged_requests.logged_requests.request: Request Headers: Content-Length: 16    | Accept-Encoding: gzip, deflate | Accept: */* | User-Agent: python-requests/2.9.1 | Connection: keep-alive   | Content-Type: application/json |
2016-04-12 21:09:57 INFO logged_requests.logged_requests.request: Request Payload: '{"name": "josh"}'
2016-04-12 21:09:57 INFO logged_requests.logged_requests.request: Status code: 200
2016-04-12 21:09:57 DEBUG logged_requests.logged_requests.request: Response Headers: 'Content-Length:   411 | Server: nginx | Connection: keep-alive | Access-Control-Allow-Credentials: true | Date: Tue, 12 Apr    2016 19:09:57 GMT | Access-Control-Allow-Origin: * | Content-Type: application/json | '
2016-04-12 21:09:57 DEBUG logged_requests.logged_requests.request: Response Content: '{\n  "args": {},   \n  "data": "{\\"name\\": \\"josh\\"}", \n  "files": {}, \n  "form": {}, \n  "headers": {\n    "Accept":   "*/*", \n    "Accept-Encoding": "gzip, deflate", \n    "Content-Length": "16", \n    "Content-Type":   "application/json", \n    "Host": "", \n    "User-Agent": "python-requests/2.9.1"\n  }, \n  "json": {\n    "name": "josh"\n  }, \n  "origin": "", \n  "url":    ""\n}\n'

LoggedRequests object can be initiated with a custom logger. If not initiated with a logger, logged_request will initiate a default logger, with StreamHandler as default handler and DEBUG as default loggging level

>>> url = ''
>>> from logged_requests import LoggedRequests
>>> req = LoggedRequests(my_custom_logger)
Release History

Release History

This version
History Node


History Node


History Node


Download Files

Download Files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

File Name & Checksum SHA256 Checksum Help Version File Type Upload Date
logged_requests-0.4.tar.gz (3.4 kB) Copy SHA256 Checksum SHA256 Source Jul 15, 2016

Supported By

WebFaction WebFaction Technical Writing Elastic Elastic Search Pingdom Pingdom Monitoring Dyn Dyn DNS Sentry Sentry Error Logging CloudAMQP CloudAMQP RabbitMQ Heroku Heroku PaaS Kabu Creative Kabu Creative UX & Design Fastly Fastly CDN DigiCert DigiCert EV Certificate Rackspace Rackspace Cloud Servers DreamHost DreamHost Log Hosting