Get the App
SLTechnology News&Howtos  ›  Development  › 

What about the garbled query from the custom menu in Wechat development?

Shulou Source: shulou.com Published: 2022-06-03 15:47:11 11月14日 Update

This article is about how to customize menu query garbled in Wechat development. The editor thinks it is very practical, so share it with you as a reference and follow the editor to have a look.

The result returned by the query to get the custom menu is garbled

Solution:

String Posturl = "https://api.weixin.qq.com/cgi-bin/menu/get?access_token=Token";// sets relevant parameters for submission HttpWebRequest request = WebRequest.Create (Posturl) as HttpWebRequest;// submission method request.Method =" Get "; / / Encoding format request.ContentType =" text/html;charset=UTF-8 "; HttpWebResponse respone = (HttpWebResponse) request.GetResponse (); StreamReader stream = new StreamReader (respone.GetResponseStream (), Encoding.UTF8); string jsonstring = stream.ReadToEnd ()

In the end, there will be no garbled code, and UTF8 should be used when decoding the stream.

StreamReader stream = new StreamReader (respone.GetResponseStream (), Encoding.UTF8)

Thank you for reading! This is the end of this article on "how to customize menu query garbled in Wechat development". I hope the above content can be of some help to you, so that you can learn more knowledge. If you think the article is good, you can share it out for more people to see!

Tags: Garbled menu query what to do development content more articles results good practical parameters articles methods methods formats see knowledge coding Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno OPPO Reno NVidia Redmi Microsoft vpn