def request(self, url, body=None, method='POST'):
        headers = {
            'Accept': 'application/json',
            'Content-Type': 'application/json; charset=UTF-8',
            'Cookie': self.cookie,
        }

        response, content = self.http.request(url, method,
                                              body, headers=headers)
        if 'set-cookie' in response:
            self.cookie = response['set-cookie']
            cookie = SimpleCookie()
            cookie.load(self.cookie)
            self.xsrf_key = cookie['GerritAccount'].value

        return response, content
dataset/ETHPy150Open bcwaldon/python-gerrit/gerrit/service.py/Connection.request/original