コード例 #1
0
        public static BestSellersListNames GetNytBestSellersListNames()
        {
            BestSellersListNames bs = null;
            string res = String.Empty;

            using (WebParser wp = new WebParser(cStrNYTBooksBaseUrl))
            {
                res = wp.Request(cStrNYTBooksResource, Method.GET, cStrNYTApiKeyStr, cStrNYTApiKeyVal);
                bs  = wp.DeserializeJson <BestSellersListNames>(res);
            }
            return(bs);
        }
コード例 #2
0
        public static BestSellersListNames GetNYTBestSellersListNames()
        {
            BestSellersListNames bs = null;

            try
            {
                using (WebParser wp = new WebParser(cStrNYTBooksBaseUrl))
                {
                    string res = wp.Request(cStrNYTBooksResource, Method.GET, cStrNYTApiKeyStr, cStrNYTApiKeyVal);

                    bs = wp.DeserializeJson <BestSellersListNames>(res);
                }
            }
            catch (Exception ex)
            {
                Console.WriteLine(ex.ToString());
            }

            return(bs);
        }
コード例 #3
0
        public static string GetRawNYTBestSellersListNames()
        {
            string res = String.Empty;

            try
            {
                using (WebParser wp = new WebParser(cStrNYTBooksBaseUrl))
                {
                    res = wp.Request(cStrNYTBooksResource, Method.GET, cStrNYTApiKeyStr, cStrNYTApiKeyVal);

                    Console.WriteLine(res);
                }
            }
            catch (Exception ex)
            {
                Console.WriteLine(ex.ToString());
            }

            return(res);
        }