public void Push(WeChatContentBase content) { HttpWebRequest myrequest = PrepareRequest(); string contentStr = content.GetContentStr(); contentStr = contentStr.Replace("#openid#", toUser); byte[] postdata = Encoding.GetEncoding("UTF-8").GetBytes(contentStr); myrequest.ContentLength = postdata.Length; Stream newStream = myrequest.GetRequestStream(); newStream.Write(postdata, 0, postdata.Length); newStream.Close(); myrequest.BeginGetResponse(null, null); }
public void Push(WeChatContentBase content) { HttpWebRequest myrequest = PrepareRequest(); string contentStr = content.GetContentStr(); contentStr = contentStr.Replace("#openid#",toUser); byte[] postdata = Encoding.GetEncoding("UTF-8").GetBytes(contentStr); myrequest.ContentLength = postdata.Length; Stream newStream = myrequest.GetRequestStream(); newStream.Write(postdata, 0, postdata.Length); newStream.Close(); myrequest.BeginGetResponse(null, null); }