Need help with Flow.request.body syntax


#1

I love mitmproxy and have used it a lot but i am still stuck at version 0.17 because my python script only works in that version. I wanted to update to the latest but can’t seem to translate my old script to work. can you please help me?
here is the script that works perfectly on mitmproxy 0.17

def response(context, flow):
if “game/system/” in flow.request.body:

Since this is script is on python2, how do I make it work on python3? Where can I get the documentation for all the flow.request? What is the new syntax for that line of code in mitmproxy 2.0 running python3 is what I am asking.


#2

Here’s the API http://docs.mitmproxy.org/en/latest/scripting/api.html#mitmproxy.http.HTTPResponse

You can use flow.response.content or flow.response.get_content()