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 http.client.BadStatusLine as e:
        if e.line == "''":  # if connection was closed, try again
            self.__conn.close()
            self.__conn.request(method, path, postdata, headers)
            return self._get_response()
        else:
            raise
    except (BrokenPipeError, ConnectionResetError):
        # Python 3.5+ raises BrokenPipeError instead of BadStatusLine when the connection was reset
        # ConnectionResetError happens on FreeBSD with Python 3.4
        self.__conn.close()
        self.__conn.request(method, path, postdata, headers)
        return self._get_response()