コード例 #1
0
        public void TestMethod1()
        {
            HttpPostHelper helper = new HttpPostHelper();

            IDictionary <string, string> dic = new Dictionary <string, string>();

            //dic.Add("code", "123456");

            string err;

            JContainer json;

            helper.PostData("http://192.168.31.180:8080/child/registerDefend.do?code=123456", dic,
                            out json, out err);


            if (json == null)

            {
                Debug.WriteLine(err);
            }
            else
            {
                Debug.WriteLine(json.ToString());
            }
        }
コード例 #2
0
        public Tuple <string, string, string, string> GetChild(string code, string unitstr, out string err)
        {
            IDictionary <string, string> dic = new Dictionary <string, string>();

            dic.Add("code", code);
            dic.Add("yljgdm", unitstr);

            string url = _base.GetServiceUrl(URLEnum.registerDefend);

            JContainer jsonResult;

            _httpPostHelper.PostData(url, dic, out jsonResult, out err);

            if (jsonResult == null)
            {
                return(null);
            }

            return(this.ConvertJContainer(jsonResult, err));
        }
コード例 #3
0
        public void TestMethodNetWorkGetList()
        {
            HttpPostHelper helper = new HttpPostHelper();

            IDictionary <string, string> dic = new Dictionary <string, string>();

            dic.Add("yljgdm", "67613231-0");
            string err;

            JContainer json;

            helper.PostData("http://192.168.31.180:8080/child/queryObservHz.do", dic, out json, out err);

            if (json == null)

            {
                Debug.WriteLine(err);
            }
            else
            {
                Debug.WriteLine(json.ToString());
            }
        }
コード例 #4
0
        public void TestMethodChangeState()
        {
            HttpPostHelper helper = new HttpPostHelper();

            IDictionary <string, string> dic = new Dictionary <string, string>();

            dic.Add("username", "admin");
            dic.Add("password", "123456");
            string err;

            JContainer json;

            helper.PostData("http://192.168.31.180:8080/child/login.do", dic, out json, out err);

            if (json == null)

            {
                Debug.WriteLine(err);
            }
            else
            {
                Debug.WriteLine(json.ToString());
            }
        }