string sendUrl = $"http://10.172.1.20/wtoptst/ws/r/awsp920"; HttpClient sendclient = new HttpClient(); string testStr = JsonConvert.SerializeObject(reques);//查看内容(测试用) HttpContent PostParams = new StringContent(JsonConvert.SerializeObject(reques), Encoding.UTF8);//创建推送连接 var postResult = await sendclient.PostAsync(sendUrl, PostParams);//post发送推送数据 var content = await postResult.Content.ReadAsStringAsync();
string getTokenUrl = $@"https://api.weixin.qq.com/cgi-bin/token"; HttpClient tokenClient = new(); string responseBody = await tokenClient.GetStringAsync(getTokenUrl); AccessTokenDto at = JsonConvert.DeserializeObject<AccessTokenDto>(responseBody);
标签:GetStringAsync,string,C#,await,JsonConvert,PostAsync,new,HttpClient From: https://www.cnblogs.com/xygsj/p/17566762.html