互億無(wú)線 · 文檔中心

號(hào)碼標(biāo)記查詢(xún)(平臺(tái)版) - 代碼示例


Java對(duì)接號(hào)碼標(biāo)記查詢(xún)接口DEMO示例
本文為您提供了Java語(yǔ)言版本的號(hào)碼標(biāo)記查詢(xún)對(duì)接DEMO示例

號(hào)碼標(biāo)記查詢(xún)接口文檔 點(diǎn)擊下載

號(hào)碼標(biāo)記查詢(xún)接入指南 點(diǎn)擊訪問(wèn)


// 接口類(lèi)型:互億無(wú)線號(hào)碼標(biāo)記查詢(xún)(平臺(tái))接口
// 賬戶(hù)注冊(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/info_service/numbermarkplatform/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 content = "02151691111";
		String _now = "" + (System.currentTimeMillis() / 1000L);
		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("content", content),
		};
		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();
		}
	}
	
}

現(xiàn)在注冊(cè),即享新用戶(hù)禮包!

在線咨詢(xún)
徐卓
銷(xiāo)售經(jīng)理微信
桂瑜琴
售后經(jīng)理微信
電話咨詢(xún)

服務(wù)熱線:

4008 808 898

服務(wù)熱線(工作時(shí)間):

4008 808 898

業(yè)務(wù)咨詢(xún)(非工作時(shí)間):

159 0212 0971

售后咨詢(xún)(非工作時(shí)間):

13816455218

您的滑动验证使用次数已达上限

驗(yàn)證碼已發(fā)送到您的手機(jī),請(qǐng)查收!

輸入驗(yàn)證碼后,點(diǎn)擊“開(kāi)通體驗(yàn)賬戶(hù)”按鈕可立即開(kāi)通體驗(yàn)賬戶(hù)。

收不到短信驗(yàn)證碼?
您的滑动验证使用次数已达上限
互億無(wú)線不提供接碼服務(wù),接碼用戶(hù)請(qǐng)勿點(diǎn)擊開(kāi)通按鈕。
×
1
we are offline