예제 #1
0
        private async Task <T> GetRequest <T>(string url)
        {
            var getRequest = new ApiGetingData <T>(_logger);

            var response = await getRequest.GetDataAsync(
                url,
                _telegramConfig.Proxies.First()
                );

            return(response);
        }
예제 #2
0
        private async Task <byte[]> SendRequest <T>(string url, T entity)
        {
            var sendRequest = new ApiGetingData <T>(_logger);

            return(await sendRequest.SendDataAsync(
                       entity,
                       url,
                       _telegramConfig.WithProxy?
                       _telegramConfig.Proxies.FirstOrDefault() :
                           null
                       ));
        }