BaseResponse <Post> IPosts.GetAllPosts(PostFilter filters) { var apiParams = filters.GetQueryParams(); var url = $"{_baseApiUrl}/posts?key={_apiKey}&{apiParams}"; var response = _httpClient.GetAsync(url).Result.Content.ReadAsStringAsync().Result; var apiResult = response.DeserializeJson <Data <Post> >().ValidateApiResponse(); return(apiResult); }
BaseResponse <Post> IPosts.GetRevisionsByIds(List <string> ids, PostFilter filters) { var apiParams = filters.GetQueryParams(); var url = $"{_baseApiUrl}/posts/"; var idsToEncode = string.Join(";", ids.ToArray()); url = url + $"{HttpUtility.UrlEncode(idsToEncode)}/revisions" + $"?key={_apiKey}&{apiParams}"; var response = _httpClient.GetAsync(url).Result.Content.ReadAsStringAsync().Result; var apiResult = response.DeserializeJson <Data <Post> >().ValidateApiResponse(); return(apiResult); }