diff options
author | Shadab Zafar <dufferzafar0@gmail.com> | 2016-08-09 11:43:29 +0530 |
---|---|---|
committer | Shadab Zafar <dufferzafar0@gmail.com> | 2016-08-15 12:00:23 +0530 |
commit | 7de48fc1977d02936614e18c568816717b55f889 (patch) | |
tree | 399b6dd3bf086b96e047516cf6bac0898fa16a5d /examples/har_dump.py | |
parent | b14eb57db190ae08266d96dbadc2458595914518 (diff) | |
download | mitmproxy-7de48fc1977d02936614e18c568816717b55f889.tar.gz mitmproxy-7de48fc1977d02936614e18c568816717b55f889.tar.bz2 mitmproxy-7de48fc1977d02936614e18c568816717b55f889.zip |
Add postData field
Diffstat (limited to 'examples/har_dump.py')
-rw-r--r-- | examples/har_dump.py | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/examples/har_dump.py b/examples/har_dump.py index d7ec9096..65cff616 100644 --- a/examples/har_dump.py +++ b/examples/har_dump.py @@ -93,7 +93,7 @@ def response(flow): response_body_decoded_size = len(flow.response.content) response_body_compression = response_body_decoded_size - response_body_size - HAR["log"]["entries"].append({ + entry = { "startedDateTime": started_date_time, "time": full_time, "request": { @@ -123,7 +123,16 @@ def response(flow): }, "cache": {}, "timings": timings, - }) + } + + if flow.request.method == "POST": + entry["request"]["postData"] = { + "mimeType": flow.request.headers.get("Content-Type", "").split(";")[0], + "text": flow.request.content, + "params": name_value(flow.request.urlencoded_form) + } + + HAR["log"]["entries"].append(entry) def done(): |