ABP中HttpClient的POST及GET请求方式
post请求方式public async TaskResult GetResult(){var token await GetAccessToken(new AccessTokenDto{appid _configuration[Wechat:appid],secret _configuration[Wechat:secret]});var url https://api.weixin.qq.com/cgi-bin/express/delivery/open_msg/get_delivery_list?access_token token;var content new StringContent({\key\:\value\}, System.Text.Encoding.UTF8, application/json);HttpResponseMessage response await _httpClient.PostAsync(url, content);if (response.IsSuccessStatusCode){string resContent response.Content.ReadAsStringAsync().Result;var code2session JsonConvert.DeserializeObjectWxLoginResponseDto(resContent);}return new Result();}get请求方式public async Taskstring GetOpenid(string code){string openId string.Empty;string _appid _configuration[Wechat:appid];string _secret _configuration[Wechat:secret];string url string.Format(_configuration[Wechat:url],_appid,_secret,code);HttpResponseMessage response await _httpClient.GetAsync(url);if (response.IsSuccessStatusCode){string resContent response.Content.ReadAsStringAsync().Result;var code2session JsonConvert.DeserializeObjectWxLoginResponseDto(resContent);if (code2session.errcode 0){openId code2session.openid;}}return openId;}