Beispiel #1
0
        public static async Task <T> GetAsync <T>(this FeedlySharpHttpClient client, string url, ILogger logger)
        {
            logger.LogDebug($"[{nameof(FeedlySharpHttpClient)} - {nameof(GetAsync)}]: Calling {url}");

            var request  = new RestRequest(url, DataFormat.Json);
            var response = await client.ExecuteGetAsync <T>(request);

            response.ThrowIfNotSuccess(logger, url);

            return(response.Data);
        }
Beispiel #2
0
        public void Should_create_instance_of_client_using_IConfiguration()
        {
            var feedlySharp = new FeedlySharpHttpClient(Mocks.MockFeedlyIConfiguration);

            Assert.NotNull(feedlySharp);
        }