怎样能快速查询ICP域名备案信息?我们可以通过网站API接口查询ICP域名备案信息,这篇文章将给大家介绍通过网站API接口查询ICP域名备案信息的方法。

调用代码

HP调用演示:

$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调用演示:

publicstaticvoidmain(Stringpath[])throwsException{URLu=newURL("http://www.beiancx.cn/icpcx?url_long=http://www.baidu.cn/");InputStreamin=u.openStream();ByteArrayOutputStreamout=newByteArrayOutputStream();try{bytebuf[]=newbyte[1024];intread=0;while((read=in.read(buf))>0){out.write(buf,0,read);}}finally{if(in!=null){in.close();}}byteb[]=out.toByteArray();System.out.println(newString(b,"utf-8"));}

Python调用演示:

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

看完这篇文章,你们学会通过网站API接口查询ICP域名备案信息的方法了吗?如果还想学到更多技能或想了解更多相关内容,欢迎关注亿速云行业资讯频道。