Exemplo n.º 1
0
 public JsonPlaceHolderProxyService(IDurableRestService durableRestService, HttpClient httpClient, IOptions <JsonPlaceHolderProxyOptions> options)
 {
     _durableRestService = durableRestService;
     _options            = options.Value;
     _httpClient         = httpClient;
 }
Exemplo n.º 2
0
 public CoasterProxyService(IDurableRestService durableRestService, HttpClient httpClient, IOptions <CoasterProxyOptions> coasterProxyOptions)
 {
     _durableRestService  = durableRestService;
     _coasterProxyOptions = coasterProxyOptions.Value;
     _httpClient          = httpClient;
 }
Exemplo n.º 3
0
        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));
        }
Exemplo n.º 4
0
 public AdministrationProxyService(IDurableRestService durableRestService, HttpClient httpClient, IOptions <AdministrationProxyOptions> administrationProxyOptions)
 {
     _durableRestService         = durableRestService;
     _administrationProxyOptions = administrationProxyOptions.Value;
     _httpClient = httpClient;
 }