返回:{"errcode":43002,"errmsg":"require POST method hint: [pklFSbMre-] rid: 5fe34695-189c82be-5a3f6937"}
代码:
string url = "http://api.weixin.qq.com/wxa/business/getliveinfo?access_token={0}";
string token = JsCode2Session();
string serviceUrl = string.Format(url, token);
var httpWebRequest = (HttpWebRequest)WebRequest.Create(serviceUrl);
httpWebRequest.ContentType = "application/json;charset=utf8"; //;charset=UTF-8
httpWebRequest.Method = "POST";
using (var streamWriter = new StreamWriter(httpWebRequest.GetRequestStream()))
{
string json = "{\"strat\":\""+ strat + "\",\"limit\":\""+ limit + "\"}";
streamWriter.Write(json);
streamWriter.Flush();
streamWriter.Close();
}
var httpResponse = (HttpWebResponse)httpWebRequest.GetResponse();
using (var streamReader = new StreamReader(httpResponse.GetResponseStream()))
{
var result = streamReader.ReadToEnd();
return ResultJson("成功", result, 0);
}
用https