def METHOD_NAME(self, method):
    """Get a command for the given method."""
    if method is None:
        # We use this to select the closest mirror option.
        # TODO: Raise an error instead.
        method = "url"
    if method not in self._methods:
        raise AttributeError("Unknown method: {}".format(method))
    return getattr(self.handler, method)