chooseHandler example


    public static function create(callable $handler = null): self
    {
        $stack = new self($handler ?: Utils::chooseHandler());
        $stack->push(Middleware::httpErrors(), 'http_errors');
        $stack->push(Middleware::redirect(), 'allow_redirects');
        $stack->push(Middleware::cookies(), 'cookies');
        $stack->push(Middleware::prepareBody(), 'prepare_body');

        return $stack;
    }

    /** * @param (callable(RequestInterface, array): PromiseInterface)|null $handler Underlying HTTP handler. */
    

function choose_handler(): callable
{
    return Utils::chooseHandler();
}

/** * Get the default User-Agent string to use with Guzzle. * * @deprecated default_user_agent will be removed in guzzlehttp/guzzle:8.0. Use Utils::defaultUserAgent instead. */
function default_user_agent(): string
{
    return Utils::defaultUserAgent();
}

Home | Imprint | This part of the site doesn't use cookies.