短信发送的过程是怎么实现的,求大神上图配上文字说明,能有接口代码更好,求大神解答!!!
现在很多家都有短信平台,阿里大于、ShareSDK随便找个注册个号,他们有SDK提供, 看看怎么用就知道了。简单
短信推送,,有相关的平台,,收费的,,(一般收费的,服务都很全)
可以去看看:
华为的,http://developer.huawei.com/push
云片:https://www.yunpian.com/
.......还有更多,这里讨论:https://www.oschina.net/question/1466285_234648
收费的 有免费试用的
这是发短信的核心代码public class SendMsg_webchinese {
public static void main(String[] args)throws Exception{
HttpClient client = new HttpClient();
PostMethod post = new PostMethod("http://gbk.sms.webchinese.cn");
post.addRequestHeader("Content-Type","application/x-www-form-urlencoded;charset=gbk");//在头文件中设置转码
NameValuePair[] data ={
new NameValuePair("Uid", "本站用户名"),
new NameValuePair("Key", "接口安全密码"),
new NameValuePair("smsMob","手机号码"),
new NameValuePair("smsText","短信内容")
};
post.setRequestBody(data);
client.executeMethod(post);
Header[] headers = post.getResponseHeaders();
int statusCode = post.getStatusCode();
System.out.println("statusCode:"+statusCode);
for(Header h : headers){
System.out.println(h.toString());
}
String result = new String(post.getResponseBodyAsString().getBytes("gbk"));
System.out.println(result);
post.releaseConnection();
}
}
速码云信息短信公司有免费的短信接口示例代码, 你复制贴过去就可以使用了
短信接口
现在很多短信推送平台,基本都是面向企业客户的, 提供的短信发送API接口,有免费试用的机会;
(创蓝云智提供短信推送API接口, 点击免费试用)