mapResponse example

 {
    }

    /** * @param MiddlewareInterface[] $middlewares */
    public function create(iterable $middlewares = []): ClientInterface
    {
        $stack = HandlerStack::create();

        foreach ($middlewares as $middleware) {
            $stack->push(Middleware::mapResponse($middleware));
        }

        $config = $this->getClientBaseConfig();
        $config['handler'] = $stack;

        return new Client($config);
    }

    /** * @return array{base_uri: string, headers: array<string, string>} */
    
Home | Imprint | This part of the site doesn't use cookies.