Esempio n. 1
0
        /// 示例:https://kyfw.12306.cn/otn/leftTicket/query?leftTicketDTO.train_date=2018-12-04&leftTicketDTO.from_station=SZQ&leftTicketDTO.to_station=CSQ&purpose_codes=ADULT
        public async Task <Base12306cnResult <OtnLeftTicketQueryResult> > OtnLeftTicketQueryAsync(OtnLeftTicketQueryInfo reqInfo)
        {
            var url = string.Format(UrlsIn12306cn._otnLeftTicketQueryUrl, reqInfo.Date, reqInfo.FromStation, reqInfo.ToStation, reqInfo.PurposeCode);

            var request = CreateRequest(url, reqInfo.Referer, HttpMethodOptions.Get);

            var res = await _netClientService.ExecuteAsync(request);

            Console.WriteLine("OtnLeftTicketQueryAsync,res.ResponseUri:{0},res.Content:{1}", res.ResponseUri, res.Content);
            Console.WriteLine("----------------------------------------------------------------");

            return(res.Content.ToModel <Base12306cnResult <OtnLeftTicketQueryResult> >());
        }
 public async Task RunTest()
 {
     var request  = new NetRequest("https://qq283335746.github.io/Home.html?r=20195001");
     var response = await _client.ExecuteAsync(request);
 }