您发布的脚本和Python的JSON模块应该可以使您受益匪浅:
def response(context, flow): if flow.request.url == "...": # optionally filter based on some criteria... with depred(flow.response): # automatically depre gzipped responses. data = json.loads(flow.response.content) data["foo"] = "bar" flow.response.content = json.dumps(data)



