EllipseSynergie\ApiResponse\AbstractResponse::errorUnauthorized PHP Method

errorUnauthorized() public method

Generates a response with a 401 HTTP header and a given message.
public errorUnauthorized ( string $message = 'Unauthorized', array $headers = [] ) : mixed
$message string
$headers array
return mixed
    public function errorUnauthorized($message = 'Unauthorized', array $headers = [])
    {
        return $this->setStatusCode(401)->withError($message, static::CODE_UNAUTHORIZED, $headers);
    }