public async Task <CatalogItemResponse> GetCatalogItemAsync(Guid productId)
        {
            CatalogItemRequestQuery query = new CatalogItemRequestQuery();

            var request = new HttpRequestMessage(HttpMethod.Get,
                                                 $"marketplacecatalog/v1/product/{Locale.Locale}/{productId}");

            request.AddQueryParameter(query.GetQuery());

            var response = await _httpClient.SendAsync(request);

            return(await response.Content.ReadAsJsonAsync <CatalogItemResponse>());
        }
Esempio n. 2
0
        public CatalogItemResponse GetCatalogItem(Guid productId)
        {
            CatalogItemRequestQuery query = new CatalogItemRequestQuery();

            RestRequestEx request = new RestRequestEx(
                $"marketplacecatalog/v1/product/{Locale.Locale}/{productId}", Method.GET);

            request.AddQueryParameters(query.GetQuery());

            IRestResponse <CatalogItemResponse> response = _httpClient
                                                           .Execute <CatalogItemResponse>(request);

            Console.WriteLine(response.Content);
            return(response.Data);
        }