c#微信企业号开发 自定义菜单40001

一直报40001的错误,在调试工具返回是正确的 附上代码 求助
public void CreateMenu(string posturl, string postData)
{
StreamWriter outstream = null;
Stream instream = null;
StreamReader sr = null;
HttpWebResponse response = null;
HttpWebRequest request = null;
Encoding encoding = Encoding.UTF8;
byte[] data = encoding.GetBytes(postData);

        request = WebRequest.Create(posturl) as HttpWebRequest;
        CookieContainer cookieContainer = new CookieContainer();
        request.CookieContainer = cookieContainer;
        request.AllowAutoRedirect = true;
        request.Method = "POST";
        request.ContentType = "application/x-www-form-urlencoded";
       // request.ContentLength = data.Length;
        outstream = new StreamWriter(request.GetRequestStream());
        //outstream.Write(data, 0, data.Length);
        outstream.Write(postData);
        outstream.Close();
        response = request.GetResponse() as HttpWebResponse;
        instream = response.GetResponseStream();
        sr = new StreamReader(instream, encoding);
        string content = sr.ReadToEnd();
        System.Web.HttpContext.Current.Response.Write(content);
    }

1个回答

Csdn user default icon
上传中...
上传图片
插入图片
抄袭、复制答案,以达到刷声望分或其他目的的行为,在CSDN问答是严格禁止的,一经发现立刻封号。是时候展现真正的技术了!
立即提问
相关内容推荐