def _post(self, url, post_data, expected_status_code=200, allow_redirects=True):
    ret = self.session.post(url=url, headers=self.headers, data=post_data, allow_redirects=allow_redirects)
    if (ret.status_code != expected_status_code):
        raise ConnectionError('Status code {status} for url {url}\n{content}'.format(status=ret.status_code, url=url, content=ret.text))
    return ret
def _post(self, url, post_data, expected_status_code=200, allow_redirects=True):
    ret = self.session.post(url=url, headers=self.headers, data=post_data, allow_redirects=allow_redirects)
    if (ret.status_code != expected_status_code):
        raise ConnectionError('Status code {status} for url {url}\n{content}'.format(status=ret.status_code, url=url, content=ret.text))
    return ret