Mtmproxy http получить запрос в сценарии - PullRequest
0 голосов
/ 08 марта 2019

Как сделать http-запрос в ответе (скрипт)

class Intercept:
    def response(self, flow: HTTPFlow):
        t_id = flow.request.query.get('task_id')
        if not t_id:
            return

        rsp = requests.get(
            'https://example.com/v1/tasks', {'task_id': t_id})

        data = rsp.json()


addons = [
    Intercept()
]

этот код блока mitmproxy response

...