commons-codec
commons-codec
1.11
Part3编写简单的短信验证功能
我这里只是编写一个简单的短信验证功能,要是用其他的语音验证。。。。等等需要去秒滴云官方下载文档,下面是编写的一个config文档,专门存放一些参数。
如果您正在学习Spring Boot,推荐一个连载多年还在继续更新的免费教程:https://blog.yoodb.com/springboot/tutorial
Part4编写http请求工具类
public class HttpUtil
{
/**
* 构造通用参数timestamp、sig和respDataType
*
* @return
*/
public static String createCommonParam()
{
// 时间戳
SimpleDateFormat sdf = new SimpleDateFormat(“yyyyMMddHHmmss”);
String timestamp = sdf.format(new Date());
// 签名
String sig = DigestUtils.md5Hex(Config.ACCOUNT_SID + Config.AUTH_TOKEN + timestamp);
return “×tamp=” + timestamp + “&sig=” + sig + “&respDataType=” + Config.RESP_DATA_TYPE;
}
/**
* post请求
*
* @param url
* 功能和操作<