public static function createIdempotentFilter()
    {
        static $retry = ['GET' => true, 'HEAD' => true, 'PUT' => true,
            'DELETE' => true, 'OPTIONS' => true, 'TRACE' => true];

        return function ($retries, AbstractTransferEvent $e) use ($retry) {
            return isset($retry[$e->getRequest()->getMethod()])
                ? self::DEFER
                : self::BREAK_CHAIN;
        };
    }