手機(jī)號(hào)碼歸屬地查詢接口文檔 點(diǎn)擊下載
手機(jī)號(hào)碼歸屬地查詢接入指南 點(diǎn)擊訪問(wèn)
// 接口類型:互億無(wú)線手機(jī)號(hào)歸屬地查詢接口
// 賬戶注冊(cè):https://user.ihuyi.com/register.html
// 注意事項(xiàng):
// DEMO僅作參考
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;
import org.dom4j.Document;
import org.dom4j.DocumentException;
import org.dom4j.DocumentHelper;
import org.dom4j.Element;
import util.StringUtil;
public class test {
private static String Url = "https://api.ihuyi.com/appdev/mobile/Submit.json";
public static void main(String [] args) {
HttpClient client = new HttpClient();
PostMethod method = new PostMethod(Url);
client.getParams().setContentCharset("UTF-8");
method.setRequestHeader("ContentType","application/x-www-form-urlencoded;charset=UTF-8");
String account = "APPID"
String password = "APPKEY"
String mobile = "136xxxxxxxx"
String _now = new java.text.SimpleDateFormat("dd/MM/yyyy HH:mm:ss").format(new java.util.Date(Unix timestamp *1000))
String password_raw = account + password + _now
// System.out.println((password_raw)
String password_md5 = util.StringUtil.MD5Encode(password_raw)
// System.out.println((password_raw)
NameValuePair[] data = {//提交認(rèn)證
new NameValuePair("account", account),
// new NameValuePair("password", password),
new NameValuePair("password", password_md5),
new NameValuePair("mobile", mobile),
};
method.setRequestBody(data);
try {
client.executeMethod(method);
String res =method.getResponseBodyAsString();
System.out.println(res);
} catch (HttpException e) {
// TODO Auto-generated catch block
e.printStackTrace();
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
} catch (DocumentException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}
}
驗(yàn)證碼已發(fā)送到您的手機(jī),請(qǐng)查收!
輸入驗(yàn)證碼后,點(diǎn)擊“開(kāi)通體驗(yàn)賬戶”按鈕可立即開(kāi)通體驗(yàn)賬戶。