已解决是后端接收类型搞错了
使用C# 获取体验版二维码,返回的数据流乱码?C# var url = $@"https://api.weixin.qq.com/wxa/get_qrcode?access_token={authorizerAccessToken}&path=pages%2Findex%3index%3D1"; HttpWebRequest request = (HttpWebRequest)WebRequest.Create(url); request.Method = "GET"; request.ContentType = "text/html;charset=UTF-8"; HttpWebResponse response = (HttpWebResponse)request.GetResponse(); Stream stm = response.GetResponseStream(); StreamReader myStreamReader = new StreamReader(stm, Encoding.Default); string retString = myStreamReader.ReadToEnd(); 请求通信后,C# 输出retString返回了一堆乱码的字符串,编码什么都尝试过了,不知道是不是我使用的方法不对 官方文档示例:请求正常的情况下,开发者可以直接将返回的二进制结果(response body)保存成图片 Connection: closeContent-Type: image/jpegContent-disposition: attachment; filename="QRCode.jpg"Date: Sun, 06 Jan 2013 10:20:18 GMTCache-Control: no-cache, must-revalidateContent-Length: 339721
2021-08-21