微信在线接口调试请求失败是什么意思

如题所述

没遇见过,可能是他们内部错误吧。
微信开发,我刚完成。调用文本消息接口的代码,发给楼主一下。

public string GroupsSendAll(string ACCESS_TOKEN, string result)
{
string wxurl = "https://api.weixin.qq.com/cgi-bin/message/mass/send?access_token=" + ACCESS_TOKEN;

string data = "{\"touser\":[\"oHSz5vlTfJL63N0wnlLfqtmcOdh8\",\"-\"],\"msgtype\": \"text\",\"text\": { \"content\": \"测试群发文本消息\"}}";

System.Net.HttpWebRequest httpWebRequest = (HttpWebRequest)System.Net.WebRequest.Create(wxurl);
httpWebRequest.Method = "POST";

httpWebRequest.Headers.Add("Accept-Charset", "utf-8");

byte[] postBytes = Encoding.UTF8.GetBytes(data);
//httpWebRequest.ContentType = "text/xml";
httpWebRequest.ContentType = "application/json; charset=utf-8";// httpWebRequest.ContentLength = Encoding.UTF8.GetByteCount(data);//strJson为json字符串
Stream stream = httpWebRequest.GetRequestStream();
stream.Write(postBytes, 0, postBytes.Length);
stream.Close();//发送完毕,接受返回值
var response = httpWebRequest.GetResponse();
Stream streamResponse = response.GetResponseStream();
StreamReader streamRead = new StreamReader(streamResponse);
String responseString = streamRead.ReadToEnd();
return responseString;

}
温馨提示:答案为网友推荐,仅供参考
第1个回答  2017-07-15
导致发送好友验证失败的原因有很多,首先要找到导致这个问题的方法,不同的原因有不同的解决方法: 1.里面貌似有个规则,如果添加同一个好友。连续发送请求数6-8次而堆放一直没有通过验证的时候。系统将不再接受请求,将提示发送失败。本回答被提问者采纳

相关了解……

你可能感兴趣的内容

本站内容来自于网友发表,不代表本站立场,仅表示其个人看法,不对其真实性、正确性、有效性作任何的担保
相关事宜请发邮件给我们
© 非常风气网