官方demo用起来感觉挺复杂,故自己写了个,发上来与社区分享:
适合简单的业务场景,调用方法极其简单,每个接口调用1行代码即可搞定,欢迎拍砖(AppSettings.GetValue<string>请改成自己的配置读取方法):
[TestMethod]
public void QuerySubAccountByName()
{
string result = RonglianRequest("QuerySubAccountByName", new { appId = RonglianUtility.config_appId, friendlyName = RonglianUtility.config_subAccount_friend });
}
[TestMethod]
public void SMSMessages()
{
string result = RonglianRequest("SMS/Messages", new { to = "18600000000", body = "the code is 8888", msgType = 0, appId = RonglianUtility.config_appId, subAccountSid = RonglianUtility.config_subAccount });
}
[TestMethod]
public void CallsVoiceVerify()
{
string result = RonglianRequest("Calls/VoiceVerify", new { to = "008618601000000", verifyCode = "8888", playTimes = 3, appId = RonglianUtility.config_appId });
}
代码下载地址:http://bbs.yuntongxun.com/attachment.php?aid=NTMyfDI5M2FiZGUwfDE0MDU5OTY0Mjd8MWUwZkVpcVE0cTllZGNOUmpiRU1PU0Mwa0hRQVNqbHVHWlVUbHk2enZoay9RTEE%3D
------解决方案--------------------
好东西,谢谢分享了