コード例 #1
0
        public async Task CollectAsync(string collectUrl, IEnumerable <KeyValuePair <string, string> > collectHeaders, IIdentityServiceClientInfo collectIdentityServiceClientInfo, string dataCollectionName, string fileName, TimeSpan timeout, bool finishWait, int tryNo, CancellationToken cancellationToken)
        {
            var endpointUrl = GetEndpointUrl(DestinationConfig.CollectPostEndpoint, dataCollectionName, fileName);

            if (string.IsNullOrEmpty(endpointUrl))
            {
                return;
            }

            await HttpUtils.SendAsync(endpointUrl, HttpMethod.Post,
                                      collectUrl, null, collectHeaders, null, timeout,
                                      request => _identityServiceHttpRequestConfigurator.ConfigAsync(request, DestinationConfig.IdentityServiceClientInfo, cancellationToken),
                                      cancellationToken : cancellationToken);
        }
コード例 #2
0
        public async Task CollectAsync(string collectUrl, IEnumerable <KeyValuePair <string, string> > collectHeaders, IIdentityServiceClientInfo collectIdentityServiceClientInfo, string dataCollectionName, string fileName, TimeSpan timeout, bool finishWait, int tryNo, CancellationToken cancellationToken)
        {
            var content =
                await HttpUtils.GetStringAsync(collectUrl, HttpMethod.Get,
                                               null, collectHeaders, null, timeout,
                                               request => _identityServiceHttpRequestConfigurator.ConfigAsync(request, collectIdentityServiceClientInfo, cancellationToken),
                                               cancellationToken : cancellationToken);

            System.Console.WriteLine(content);
        }