溫馨提示×

您好,登錄后才能下訂單哦!

密碼登錄×
登錄注冊(cè)×
其他方式登錄
點(diǎn)擊 登錄注冊(cè) 即表示同意《億速云用戶服務(wù)條款》

怎么通過網(wǎng)站API接口查詢ICP域名備案信息

發(fā)布時(shí)間:2020-06-02 15:42:25 來源:億速云 閱讀:593 作者:Leah 欄目:開發(fā)技術(shù)

怎樣能快速查詢ICP域名備案信息?我們可以通過網(wǎng)站API接口查詢ICP域名備案信息,這篇文章將給大家介紹通過網(wǎng)站API接口查詢ICP域名備案信息的方法。

調(diào)用代碼

HP調(diào)用演示:

$url = 'http://www.baidu.com';
$api_url = 'http://www.beiancx.cn/icpcx?url_long=http://www.baidu.cn/;
$short_url = file_get_contents($api_url);
echo $short_url;

JAVA調(diào)用演示:

public static void main(String path[]) throws Exception {
URL u = new URL("http://www.beiancx.cn/icpcx?url_long=http://www.baidu.cn/");
InputStream in = u.openStream();
ByteArrayOutputStream out = new ByteArrayOutputStream();
try {
byte buf[] = new byte[1024];
int read = 0;
while ((read = in .read(buf)) > 0) {
out.write(buf, 0, read);
}
} finally {
if ( in != null) {
in .close();
}
}
byte b[] = out.toByteArray();
System.out.println(new String(b, "utf-8"));
}

Python調(diào)用演示:

import urllib, urllib2, sys
host = 'http://www.beiancx.cn'
path = '/icpcx?url_long'
method = 'GET'
querys = 'url_long=http%3A%2F%2Fwww.baidu.com'
bodys = {}
url = host + path + '?' + querys
request = urllib2.Request(url)
response = urllib2.urlopen(request)
content = response.read()
if (content):
print(content)

看完這篇文章,你們學(xué)會(huì)通過網(wǎng)站API接口查詢ICP域名備案信息的方法了嗎?如果還想學(xué)到更多技能或想了解更多相關(guān)內(nèi)容,歡迎關(guān)注億速云行業(yè)資訊頻道。

向AI問一下細(xì)節(jié)

免責(zé)聲明:本站發(fā)布的內(nèi)容(圖片、視頻和文字)以原創(chuàng)、轉(zhuǎn)載和分享為主,文章觀點(diǎn)不代表本網(wǎng)站立場(chǎng),如果涉及侵權(quán)請(qǐng)聯(lián)系站長(zhǎng)郵箱:is@yisu.com進(jìn)行舉報(bào),并提供相關(guān)證據(jù),一經(jīng)查實(shí),將立刻刪除涉嫌侵權(quán)內(nèi)容。

AI