public async Task <HttpResponse> GetLatestOrderByFeatured <T>(int limit) { var url = _urlGeneratorSimple.BaseContentApiUrl <T>().AddExtraToUrl($"latest/{limit}").AddQueryStrings(new Query("featured", "true")); var httpResponse = await _httpClient.Get(url, _authenticationHeaders); return(HttpResponse.Build <T>(httpResponse)); }
public async Task <Document> GetSecureDocument(string assetId, string groupSlug) { var url = _urlGeneratorSimple.BaseContentApiUrl <Document>().AddSlug($"{groupSlug}/{assetId}"); var loggedInPerson = _loggedInHelper.GetLoggedInPerson(); if (string.IsNullOrEmpty(loggedInPerson.Email)) { _logger.LogWarning($"Document {assetId} was requested, but the user wasn't logged in"); return(null); } AddHeader("jwtCookie", loggedInPerson.rawCookie); return(await GetResponseAsync <Document>(url)); }
public async Task <T> GetResponse <T>() { var url = _urlGeneratorSimple.BaseContentApiUrl <T>().TrimEnd('/'); return(await GetResponseAsync <T>(url)); }