Esempio n. 1
0
        //同步请求
        public string SyncRequest(string Url, string HttpMethod, Parameter u_key, List <Parameter> ListParam, List <Parameter> ListFile)
        {
            if (ListParam == null)
            {
                ListParam = new List <Parameter>();
            }

            if (u_key != null)
            {
                ListParam.Add(u_key);
            }

            string QueryStr = HttpUtility.NormalizeRequestParameters(ListParam);

            SyncHttp Http = new SyncHttp();

            if (HttpMethod == "GET")
            {
                return(Http.HttpGet(Url, QueryStr));
            }
            else if (ListFile == null || ListFile.Count == 0)
            {
                return(Http.HttpPost(Url, QueryStr));
            }
            else
            {
                return(Http.oAuthWebRequestWithPic(Url, QueryStr, ListFile[0].Value, Path.GetFileName(ListFile[0].Value)));
            }
        }