From 92597f82ea8e4747ce1836ecd5eb2479486e8647 Mon Sep 17 00:00:00 2001 From: Aldo Cortesi Date: Thu, 18 Feb 2016 09:19:05 +1300 Subject: Docs and examples to top level --- examples/modify_form.py | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 examples/modify_form.py (limited to 'examples/modify_form.py') diff --git a/examples/modify_form.py b/examples/modify_form.py new file mode 100644 index 00000000..3e9d15c0 --- /dev/null +++ b/examples/modify_form.py @@ -0,0 +1,5 @@ +def request(context, flow): + if "application/x-www-form-urlencoded" in flow.request.headers.get("content-type", ""): + form = flow.request.get_form_urlencoded() + form["mitmproxy"] = ["rocks"] + flow.request.set_form_urlencoded(form) -- cgit v1.2.3