コード例 #1
0
        public async Task <ListOfProducts> ListOfProducts(ListProductParams @params = null)
        {
            Authenticated();

            HttpResponseMessage responseMessage;

            if (@params != null)
            {
                string queryString = await GenerateQueryString(@params);

                responseMessage = await _client.GetAsync("https://api.vhx.tv/products/" + queryString);
            }
            else
            {
                responseMessage = await _client.GetAsync("https://api.vhx.tv/products/");
            }

            if (responseMessage.IsSuccessStatusCode)
            {
                string content = await responseMessage.Content.ReadAsStringAsync();

                return(JsonConvert.DeserializeObject <ListOfProducts>(content));
            }
            else
            {
                throw NotSuccessCode(responseMessage).Result;
            }
        }
コード例 #2
0
 public async Task <ListOfProducts> ListOfProducts(ListProductParams @params)
 {
     return(await _resources.ListOfProducts(@params));
 }