mirror of
https://github.com/wiremock/WireMock.Net.git
synced 2026-03-11 21:12:16 +01:00
Add unit tests for HttpClient with WebProxy (#1010)
* Add test for SSL / Https * Add unit tests for HttpClient with WebProxy * cert.pem * x * skip * example google * revert * host tests * sonar
This commit is contained in:
@@ -12,8 +12,6 @@ internal class HostUrlOptions
|
||||
|
||||
public int? Port { get; set; }
|
||||
|
||||
public int? HttpsPort { get; set; }
|
||||
|
||||
public HostingScheme HostingScheme { get; set; }
|
||||
|
||||
public IReadOnlyList<HostUrlDetails> GetDetails()
|
||||
|
||||
@@ -141,6 +141,31 @@ public partial class WireMockServer : IWireMockServer
|
||||
return client;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Create a <see cref="HttpClient"/> which can be used to call this instance.
|
||||
/// <param name="handlers">
|
||||
/// <param name="innerHandler">The inner handler represents the destination of the HTTP message channel.</param>
|
||||
/// An ordered list of System.Net.Http.DelegatingHandler instances to be invoked
|
||||
/// as an System.Net.Http.HttpRequestMessage travels from the System.Net.Http.HttpClient
|
||||
/// to the network and an System.Net.Http.HttpResponseMessage travels from the network
|
||||
/// back to System.Net.Http.HttpClient. The handlers are invoked in a top-down fashion.
|
||||
/// That is, the first entry is invoked first for an outbound request message but
|
||||
/// last for an inbound response message.
|
||||
/// </param>
|
||||
/// </summary>
|
||||
[PublicAPI]
|
||||
public HttpClient CreateClient(HttpMessageHandler innerHandler, params DelegatingHandler[] handlers)
|
||||
{
|
||||
if (!IsStarted)
|
||||
{
|
||||
throw new InvalidOperationException("Unable to create HttpClient because the service is not started.");
|
||||
}
|
||||
|
||||
var client = HttpClientFactory2.Create(innerHandler, handlers);
|
||||
client.BaseAddress = new Uri(Url!);
|
||||
return client;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Create <see cref="HttpClient"/>s (one for each URL) which can be used to call this instance.
|
||||
/// <param name="innerHandler">The inner handler represents the destination of the HTTP message channel.</param>
|
||||
|
||||
Reference in New Issue
Block a user