提醒:如果Encoding.Default不是 UTF8,请直接使用 UTF8
string uid = "<enter your UID>", pas = "<enter your UID Pass>", url = "http://api.weimi.cc/2/account/balance.html"; byte[] byteArray = Encoding.UTF8.GetBytes("uid=" + uid + "&pas=" + pas + "&type=json"); HttpWebRequest webRequest = (HttpWebRequest)WebRequest.Create(new Uri(url)); webRequest.Method = "GET"; webRequest.ContentType = "application/x-www-form-urlencoded"; webRequest.ContentLength = byteArray.Length; Stream newStream = webRequest.GetRequestStream(); newStream.Write(byteArray, 0, byteArray.Length); newStream.Close(); HttpWebResponse response = (HttpWebResponse)webRequest.GetResponse(); StreamReader php = new StreamReader(response.GetResponseStream(), Encoding.UTF8); string Message = php.ReadToEnd(); System.Console.Write(Message); System.Console.Read(); /* 注意:以上参数传入时不包括“<>”符号 */
{ "sms-left":157, "sms-sent":13, "sms-total":190, "mms-left":90, "mms-sent":10, "mms-total":100,"ivr-left":90, "ivr-sent":10, "ivr-total":100,,"gj-left":90, "gj-sent":10, "gj-total":100 "msg":"微米账户余额查询" }
√ 开发文档
√ 短信接口
√ 彩信接口
√ 账户余额查询接口
√ PHP示例
√ Java示例
√ Python示例