資源簡介
執行前請先設置修改 src/test.java 文件
//用戶名
private static String Uid = "uid";
//接口安全秘鑰(不是登錄密碼)
private static String Key = "key";
//手機號碼,多個號碼如13800000000,13800000001,13800000002
private static String smsMob = "13800000000";
//短信內容
private static String smsText = "驗證碼:8888";
其他說明請參考
http://www.smschinese.cn/api.shtml
注意:
如果放到項目里面運行時會亂碼
請調用接口之前打印下你串進去的內容,看看會不會亂碼
代碼片段和文件信息
??
import?java.io.IOException;
import?java.net.URL;
import?java.util.ArrayList;
import?java.util.HashMap;
import?java.util.List;
import?java.util.Map;
import?org.apache.http.HttpEntity;
import?org.apache.http.NameValuePair;
import?org.apache.http.client.config.RequestConfig;
import?org.apache.http.client.entity.UrlEncodedFormEntity;
import?org.apache.http.client.methods.CloseableHttpResponse;
import?org.apache.http.client.methods.HttpGet;
import?org.apache.http.client.methods.HttpPost;
import?org.apache.http.conn.ssl.DefaultHostnameVerifier;
import?org.apache.http.conn.util.PublicSuffixMatcher;
import?org.apache.http.conn.util.PublicSuffixMatcherLoader;
import?org.apache.http.impl.client.CloseableHttpClient;
import?org.apache.http.impl.client.HttpClients;
import?org.ap
?屬性????????????大小?????日期????時間???名稱
-----------?---------??----------?-----??----
?????文件????????462??2017-03-22?19:00??msgProGBK\.classpath
?????文件????????385??2017-03-22?18:53??msgProGBK\.project
?????文件?????????86??2017-03-22?18:53??msgProGBK\.settings\org.eclipse.core.resources.prefs
?????文件????????629??2017-03-22?18:54??msgProGBK\.settings\org.eclipse.jdt.core.prefs
?????文件??????61829??2017-03-22?18:53??msgProGBK\bin\commons-logging-1.2.jar
?????文件?????727567??2017-03-22?18:53??msgProGBK\bin\httpclient-4.5.jar
?????文件???????8599??2017-03-22?19:00??msgProGBK\bin\HttpClientUtil.class
?????文件?????322234??2017-03-22?18:53??msgProGBK\bin\httpcore-4.4.1.jar
?????文件???????1232??2017-03-22?19:01??msgProGBK\bin\test.class
?????文件??????61829??2017-03-22?18:53??msgProGBK\lib\commons-logging-1.2.jar
?????文件?????727567??2017-03-22?18:53??msgProGBK\lib\httpclient-4.5.jar
?????文件?????322234??2017-03-22?18:53??msgProGBK\lib\httpcore-4.4.1.jar
?????文件???????9198??2017-03-22?19:13??msgProGBK\src\HttpClientUtil.java
?????文件????????799??2017-03-22?19:47??msgProGBK\src\test.java
?????文件????????462??2017-03-22?19:02??msgProUTF8\.classpath
?????文件????????382??2017-03-22?17:09??msgProUTF8\.project
?????文件????????629??2017-03-22?17:30??msgProUTF8\.settings\org.eclipse.jdt.core.prefs
?????文件??????61829??2017-03-22?18:53??msgProUTF8\bin\commons-logging-1.2.jar
?????文件?????727567??2017-03-22?18:53??msgProUTF8\bin\httpclient-4.5.jar
?????文件???????8599??2017-03-22?19:02??msgProUTF8\bin\HttpClientUtil.class
?????文件?????322234??2017-03-22?18:53??msgProUTF8\bin\httpcore-4.4.1.jar
?????文件???????1240??2017-03-22?19:02??msgProUTF8\bin\test.class
?????文件??????61829??2017-03-22?18:53??msgProUTF8\lib\commons-logging-1.2.jar
?????文件?????727567??2017-03-22?18:53??msgProUTF8\lib\httpclient-4.5.jar
?????文件?????322234??2017-03-22?18:53??msgProUTF8\lib\httpcore-4.4.1.jar
?????文件???????9409??2017-03-22?19:12??msgProUTF8\src\HttpClientUtil.java
?????文件????????826??2017-03-22?19:47??msgProUTF8\src\test.java
?????文件????????485??2017-03-22?19:58??說明.txt
?????目錄??????????0??2017-03-22?19:03??msgProGBK\.settings
?????目錄??????????0??2017-03-22?19:03??msgProGBK\bin
............此處省略11個文件信息
評論
共有 條評論