示例#1
0
        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));
        }
示例#2
0
        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));
        }
示例#3
0
        public async Task <T> GetResponse <T>()
        {
            var url = _urlGeneratorSimple.BaseContentApiUrl <T>().TrimEnd('/');

            return(await GetResponseAsync <T>(url));
        }