mirror of
https://github.com/wiremock/WireMock.Net.git
synced 2026-04-26 02:08:29 +02:00
Update standalone commandline parsing (#27)
This commit is contained in:
@@ -120,18 +120,21 @@ namespace WireMock.Server
|
||||
Given(Request.Create().WithPath(AdminRequests + "/find").UsingPost()).RespondWith(new DynamicResponseProvider(RequestsFind));
|
||||
}
|
||||
|
||||
#region Proxy and Record
|
||||
private void InitProxyAndRecord(ProxyAndRecordSettings settings)
|
||||
{
|
||||
Given(Request.Create().WithPath("/*").UsingAnyVerb()).RespondWith(new ProxyAsyncResponseProvider(ProxyAndRecordAsync, settings));
|
||||
}
|
||||
|
||||
#region Proxy and Record
|
||||
|
||||
private async Task<ResponseMessage> ProxyAndRecordAsync(RequestMessage requestMessage, ProxyAndRecordSettings settings)
|
||||
{
|
||||
var responseMessage = await HttpClientHelper.SendAsync(requestMessage, settings.Url);
|
||||
|
||||
var mapping = ToMapping(requestMessage, responseMessage);
|
||||
SaveMappingToFile(mapping);
|
||||
if (settings.SaveMapping)
|
||||
{
|
||||
var mapping = ToMapping(requestMessage, responseMessage);
|
||||
SaveMappingToFile(mapping);
|
||||
}
|
||||
|
||||
return responseMessage;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user