public static IEnumerable<RecordInfo> GetSeesionRecord(string openid, DateTime start, DateTime end,
     int index, int size)
 {
     RecordQuery query = new RecordQuery(start, end, index, size) { OpenId = openid };
     string url = WeUtil.GetUrl(WeSessionConst.RECORD_GET);
     // WeixinResult resutl = WeUtil.PostDataToUri(url, query.WriteXml(), new SessionRecord());
     string request = query.WriteJson();
     //string xml = query.WriteXml();
     WebResponse response = HttpPost(new Uri(url), Encoding.UTF8.GetBytes(request), "application/json");
     var res = WeUtil.PostDataToUri(url, request, new SessionRecord());
     // var resul = NetUtil.ReadObjectFromResponse(NetUtil.HttpPost(new Uri(url), xml, "text/xml"), null, new SessionRecord());
     return WeUtil.PostDataToUri(url, request, new SessionRecord()).Recoreds;
 }
Beispiel #2
0
        public static IEnumerable <RecordInfo> GetSeesionRecord(string openid, DateTime start, DateTime end,
                                                                int index, int size)
        {
            RecordQuery query = new RecordQuery(start, end, index, size)
            {
                OpenId = openid
            };
            string url = WeUtil.GetUrl(WeSessionConst.RECORD_GET);
            // WeixinResult resutl = WeUtil.PostDataToUri(url, query.WriteXml(), new SessionRecord());
            string request = query.WriteJson();
            //string xml = query.WriteXml();
            WebResponse response = HttpPost(new Uri(url), Encoding.UTF8.GetBytes(request), "application/json");
            var         res      = WeUtil.PostDataToUri(url, request, new SessionRecord());

            // var resul = NetUtil.ReadObjectFromResponse(NetUtil.HttpPost(new Uri(url), xml, "text/xml"), null, new SessionRecord());
            return(WeUtil.PostDataToUri(url, request, new SessionRecord()).Recoreds);
        }