예제 #1
0
        public async Task <FindAnagramResponse> FindAnagram(string word, CancellationToken cancellationToken = default)
        {
            var requestUrl = _httpRequestService.GenerateUrlWithQueryString(
                Constants.RequestFindAnagram, new KeyValuePair <string, object>("Word", word));
            var request = await _httpClient.GetAsync(requestUrl, cancellationToken);

            if (!request.IsSuccessStatusCode)
            {
                return(null);
            }

            return(_jsonService.ConvertFromJsonStream <FindAnagramResponse>(await request.Content.ReadAsStreamAsync()));
        }