Esempio n. 1
0
        /// <summary>
        /// Post请求处理
        /// </summary>
        /// <param name="uri"></param>
        /// <param name="objs"></param>
        /// <returns></returns>
        private Task <HttpResponseMessage> PostRequest(string uri, params object[] objs)
        {
            Task <HttpResponseMessage> rd;

            if (objs == null || objs.Length == 0)
            {
                rd = HttpWebNetwork.PostRequest(uri);
            }
            else
            {
                object obj = objs[0];
                if (obj is Stream)
                {
                    rd = HttpWebNetwork.PostRequest(uri, (FileStream)obj);
                }
                else
                {
                    string body = obj.ToJsonString();
                    rd = HttpWebNetwork.PostRequest(uri, body);
                }
            }
            return(rd);
        }