public JsonPlaceHolderProxyService(IDurableRestService durableRestService, HttpClient httpClient, IOptions <JsonPlaceHolderProxyOptions> options) { _durableRestService = durableRestService; _options = options.Value; _httpClient = httpClient; }
public CoasterProxyService(IDurableRestService durableRestService, HttpClient httpClient, IOptions <CoasterProxyOptions> coasterProxyOptions) { _durableRestService = durableRestService; _coasterProxyOptions = coasterProxyOptions.Value; _httpClient = httpClient; }
private async Task RequestOfT(ICorrelationService correlationService, IGuidService guidService, IDurableRestService durableRestService) { correlationService.CorrelationId = guidService.NewGuid().ToString(); using var httpClient = new HttpClient { BaseAddress = new Uri("https://jsonplaceholder.typicode.com/") }; var httpRequestMessage = new HttpRequestMessage { Method = HttpMethod.Get, RequestUri = new Uri("todos/1", UriKind.Relative) }; var retrys = 3; var timeoutInSeconds = 30; var restResponse = await durableRestService.ExecuteAsync <Todo>(httpClient, httpRequestMessage, retrys, timeoutInSeconds).ConfigureAwait(false); Console.WriteLine("Content: " + await restResponse.HttpResponseMessage.Content.ReadAsStringAsync().ConfigureAwait(false)); }
public AdministrationProxyService(IDurableRestService durableRestService, HttpClient httpClient, IOptions <AdministrationProxyOptions> administrationProxyOptions) { _durableRestService = durableRestService; _administrationProxyOptions = administrationProxyOptions.Value; _httpClient = httpClient; }