JAVA通过http调用验证码短信接口源码
2015-03-11 17:56
573 查看
通过验证码短信http调用接口,您可以很快速的在网站或者app中集成手机号验证功能,该源码只是核心代码,具体可以根据您的实际需求进行扩展。
该DEMO是JAVA通过http调用验证码短信接口源码;
自助申请帐户地址:http://www.ihuyi.com/product.php
完整接口文件地址:http://www.ihuyi.com/upload/file/cu-fa-jie-kou.rar
该DEMO是JAVA通过http调用验证码短信接口源码;
//import java.io.FileInputStream; //import java.io.FileNotFoundException; import java.io.IOException; import org.apache.commons.httpclient.HttpClient; import org.apache.commons.httpclient.HttpException; import org.apache.commons.httpclient.NameValuePair; import org.apache.commons.httpclient.methods.PostMethod; public class sendsms { private static String Url = "http://106.ihuyi.com/webservice/sms.php?method=Submit"; public static void main(String [] args) { HttpClient client = new HttpClient(); PostMethod method = new PostMethod(Url); //client.getParams().setContentCharset("GBK"); client.getParams().setContentCharset("UTF-8"); method.setRequestHeader("ContentType","application/x-www-form-urlencoded;charset=UTF-8"); String content = new String("您的验证码是:7528。请不要把验证码泄露给其他人。"); NameValuePair[] data = {//提交短信 new NameValuePair("account", "用户名"), new NameValuePair("password", "密码"), new NameValuePair("mobile", "手机号码"), new NameValuePair("content", content), }; method.setRequestBody(data); try { client.executeMethod(method); System.out.println(method.getResponseBodyAsString()); } catch (HttpException e) { // TODO Auto-generated catch block e.printStackTrace(); } catch (IOException e) { // TODO Auto-generated catch block e.printStackTrace(); } //System.out.println("短信提交成功"); } }
自助申请帐户地址:http://www.ihuyi.com/product.php
完整接口文件地址:http://www.ihuyi.com/upload/file/cu-fa-jie-kou.rar
相关文章推荐
- php通过http调用验证码短信接口源码
- ASP通过http调用验证码短信接口源码
- VB通过http调用验证码短信接口源码
- ASP.net通过http调用验证码短信接口源码
- JSP通过http调用验证码短信接口源码
- 验证码短信接口VB6调用http源码
- 验证码短信接口php调用http源码
- Java调用WebService接口实现发送手机短信验证码功能,java 手机验证码,WebService接口调用
- Java调用WebService接口实现发送手机短信验证码功能,java 手机验证码,WebService接口调用
- Java调用WebService接口实现发送手机短信验证码功能
- Java调用WebService接口实现发送手机短信验证码功能
- Java调用WebService接口实现发送手机短信验证码功
- Java调用WebService接口实现发送手机短信验证码功能
- JAVA后台通过http调用短信API
- Java调用WebService接口实现发送手机短信验证码功能
- JAVA调用云平台短信验证接口
- Java调用WebService接口实现发送手机短信验证码功能,java 手机验证码,WebService接口调用
- Java调用WebService接口实现发送手机短信验证码功能,java 手机验证码,WebService接口调用
- 调用飞信网关服务器HTTP接口发送短信的ASP源码
- Java调用WebService接口实现发送手机短信验证码功能,java 手机验证码,WebService接口调用