Skip to content

SharonBrizinov/DumpRequests

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 

Repository files navigation

DumpRequests

Simple stupid class for globaly auto patching the entire python requests library to dump all requests and responses, for debug purposes.

This is a simple class DumpRequests that dynamically patched the popular python requests module to dump ALL requests and responses without the need to specify individual hooks for each call. It does it by setting up dynamic hooks for every HTTP method (GET, POST, DELETE, OPTIONS, etc) and it also patches the Sessions class. This comes very handy when doing extensive debug sessions and one needs to review all ongoing HTTP traffic generated from requests calls. The idea was based on this project.

How to use

dr = DumpRequests()
print(f"[-] DumpRequests working dir is {dr.working_dir} (is currently patched: {dr.is_requests_debug_already_patched})")
# .. now we need to hyper debug and dump all HTTP requests and responses.
#   let's patch - set up hooks to dump all requests HTTP traffic
dr.patch()
requests.get("https://google.com")
requests.post("http://google.com",data={"a":"b"})

# .. later on you can also unpatch
dr.unpatch()

Demo

tmpvxo1g5zk_and_iterm

image

About

Auto patching python requests library to dump all requests and responses, for debug purposes.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages