private FaceClient(Uri baseUrl, string key, PipelineOptions options) { _options = options; _baseUrl = baseUrl; _keyHeader = new Header(s_keyHeaderName, key); _client = ClientPipeline.Create(options, SdkName, SdkVersion); }
public FileUri(string file, PipelineOptions options = default) { if (options == default) { _options = new PipelineOptions(); } else { _options = options; } Pipeline = ClientPipeline.Create(_options, SdkName, SdkVersion); _baseUri = new Uri(file); }
public void Basics() { var options = new PipelineOptions(); options.Transport = new MockTransport(500, 1); options.RetryPolicy = new CustomRetryPolicy(); options.LoggingPolicy = new TestLoggingPolicy(); options.Logger = new MockLogger(); var pipeline = ClientPipeline.Create(options, "test", "1.0.0"); using (var context = pipeline.CreateContext(options, cancellation: default)) { context.SetRequestLine(ServiceMethod.Get, new Uri("https://contoso.a.io")); pipeline.ProcessAsync(context).Wait(); Assert.AreEqual(1, context.Response.Status); var result = options.LoggingPolicy.ToString(); Assert.AreEqual("REQUEST: Get https://contoso.a.io/\nRESPONSE: 500\nREQUEST: Get https://contoso.a.io/\nRESPONSE: 1\n", result); } }
public ConfigurationClient(string connectionString, PipelineOptions options) { _options = options; Pipeline = ClientPipeline.Create(_options, SdkName, SdkVersion); ParseConnectionString(connectionString, out _baseUri, out _credential, out _secret); }