コード例 #1
0
        /// <summary>
        /// POST方式请求 微信返回信息
        /// </summary>
        /// <param name="parameters">参数</param>
        /// <param name="URL">请求地址</param>
        /// <returns>返回字符</returns>
        public string PostForWeiXin(StringBuilder parameters, string URL)
        {
            string access_token = getAccessToken();
            string url          = URL + "access_token=" + access_token;

            HttpWebResponse response = new HttpWebResponseUtility().WXCreateGetHttpResponse(url, parameters, 10000, null, Encoding.UTF8, null);
            StreamReader    reader   = new StreamReader(response.GetResponseStream(), Encoding.UTF8);
            string          str      = reader.ReadToEnd();

            WriteLog(url + "----------------" + parameters + "---------------" + str);
            return(str);
        }