Shenglian / -WORK_TIP

工作上小技巧
4 stars 1 forks source link

[mitmproxy] Save body response from specific URL to file and decode it using mitmproxy #170

Open Shenglian opened 5 years ago

Shenglian commented 5 years ago
import mitmproxy
def response(flow):
    if flow.request.pretty_url.endswith("example.com/orders"):
        with open("orders.html","wb") as f:
                f.write(flow.response.content)

Save this script to save_body.py and use it with mitmdump -s save_body.py