def METHOD_NAME(self, method, path, postdata):
    '''
    Do a HTTP request, with retry if we get disconnected (e.g. due to a timeout).
    This is a workaround for https://bugs.python.org/issue3566 which is fixed in Python 3.5.
    '''
    headers = {'Host': self.__url.hostname,
               'User-Agent': USER_AGENT,
               'Authorization': self.__auth_header,
               'Content-type': 'application/json'}
    try:
        self.__conn.request(method, path, postdata, headers)
        return self._get_response()
    except Exception as e:
        # If connection was closed, try again.
        # Python 3.5+ raises BrokenPipeError instead of BadStatusLine when the connection was reset.
        # ConnectionResetError happens on FreeBSD with Python 3.4.
        # This can be simplified now that we depend on Python 3 (previously, we could not
        # refer to BrokenPipeError or ConnectionResetError which did not exist on Python 2)
        if ((isinstance(e, BadStatusLine) and e.line == "''")
            or e.__class__.__name__ in ('BrokenPipeError', 'ConnectionResetError')):
            self.__conn.close()
            self.__conn.request(method, path, postdata, headers)
            return self._get_response()
        else:
            raise