Esempio n. 1
0
        private Task <IApiResponse <T> > SendData <T>(
            Uri uri,
            HttpMethod method,
            object body,
            string accepts,
            string contentType,
            TimeSpan timeout,
            CancellationToken cancellationToken,
            string twoFactorAuthenticationCode = null,
            Uri baseAddress = null)
            where T : class
        {
            uri.ArgumentNotNull(nameof(uri));
            timeout.ArgumentNotNull(nameof(timeout));

            var request = new Request
            {
                Method      = method,
                BaseAddress = baseAddress ?? BaseAddress,
                Endpoint    = uri,
                Timeout     = timeout
            };

            return(SendDataInternal <T>(body, accepts, contentType, cancellationToken, twoFactorAuthenticationCode, request));
        }