コード例 #1
0
        private static async Task <MicRestClient> CreateFromHostname(string hostname, string apiKey, HttpClient httpClient, CancellationToken cancelToken)
        {
            var manifest = await MicManifest.GetMicManifest(hostname, httpClient, cancelToken)
                           .ConfigureAwait(continueOnCapturedContext: false);

            //string apiKey = manifest.ApiKeyId;
            var micClient = new MicRestClient(manifest, apiKey, httpClient);

            return(micClient);
        }
コード例 #2
0
        public static async Task <MicRestClient> CreateFromHostname(
            string hostname, string apiKey, CancellationToken cancelToken = default)
        {
            var           handler    = new MicRestHttpHandler(new HttpClientHandler());
            var           httpClient = new HttpClient(handler);
            MicRestClient micClient  = await CreateFromHostname(hostname, apiKey, httpClient, cancelToken)
                                       .ConfigureAwait(continueOnCapturedContext: false);

            handler.MicClient = micClient;
            return(micClient);
        }
コード例 #3
0
 public MicRestHttpHandler(MicRestClient micClient) : base() =>