public async Task <ServiceResponse> GetServiceResponseForRequest(Uri host, IInteraction interaction, bool lowerCaseHeaders) { return(await _service.InvokeServiceEndpoint( interaction.Method, null, null, new Uri($"{_redirectHost.GetLeftPart(UriPartial.Authority)}{interaction.Path}"), interaction.RequestHeaders)); }
public async Task <ServiceResponse> GetServiceResponseForRequest(Uri host, IInteraction interaction, bool lowerCaseHeaders) { var response = await _service.InvokeServiceEndpoint( interaction.Method, null, null, new Uri($"{_redirectHost.GetLeftPart(UriPartial.Authority)}{interaction.Path}"), interaction.RequestHeaders); var builder = new MarkdownInteraction.Builder() .From(interaction) .ResponseHeaders(response.Headers); if (response.Body != null && response.ContentType != null) { builder.ResponseBody(response.Body.ToString(), response.ContentType); } else { builder.RemoveResponseBody(); } var interactionToRecord = builder.Build(); _allInteractions[interactionToRecord.Number] = interactionToRecord; return(response); }