示例#1
0
        public async Task <string> WebWXSendMsg(WebWXSendMsgDto msgSend)
        {
            var requestPayload = new WebWXMsgSendRequestPayload()
            {
                BaseRequest = new BaseRequestDto()
                {
                    Uin      = msgSend.Wxuin,
                    Sid      = msgSend.Wxsid,
                    Skey     = msgSend.Skey,
                    DeviceID = msgSend.DeviceId,
                },
                Scene = 0,
                Msg   = msgSend.Msg,
            };
            var requestPayloadStr = JsonConvert.SerializeObject(requestPayload);
            var paramsDic         = new Dictionary <string, string>();

            paramsDic.Add("pass_ticket", msgSend.PassTicket);
            var headers = new Dictionary <string, string>();

            headers.Add("Cookie", $"wxuin={msgSend.Wxuin};webwx_data_ticket={msgSend.DataTicket};");
            var response = await HttpUtil.PostAsync("https://wx.qq.com/cgi-bin/mmwebwx-bin/webwxsendmsg", paramDic : paramsDic, postContent : requestPayloadStr, headers : headers);

            return(response);
        }
示例#2
0
 public async Task <string> WebWXSendMsg(WebWXSendMsgDto msgSend)
 {
     return(await weloginService.WebWXSendMsg(msgSend));
 }