本篇内容主要讲解“微信域名拦截查询的方法有哪些”,感兴趣的朋友不妨来看看。本文介绍的方法操作简单快捷,实用性强。下面就让小编来带大家学习“微信域名拦截查询的方法有哪些”吧!
1、http://www.qqdwz.cn/ymjc?url_long=http://www.baidu.com
2、 http://www.maoapi.cn/wxymjc?url_long=http://www.baidu.com
接口说明 :
www.baidu.com 换成 需要检测的域名链接就可以了,这里被检测的对象可以是域名,也可以是链接,或者说是带参数的链接也可以的!
注意事项:
① 调用api接口时,只需在URL=后面填写需要压缩生成的长网址即可。
② 接口支持url参数,当url中出现 & 符号时,请用 %26 代替(或者使用url编码格式),否则参数可能会丢失。
③ 填写url时,必须要以http(s)://开头,否则可能会导致检测失败。
1、 http://www.qqdwz.cn/ymjc
2、 http://www.maoapi.cn/jiance
返回说明:
{"status":1,"msg":"域名正常"}
{"status":0,"msg":"域名被封"}
PHP调用演示:
$url = 'http://www.baidu.com';
$api_url = 'http://www.maoapi.cn/wxymjc?url_long?url_long=http://www.baidu.com;
$short_url = file_get_contents($api_url);
echo $short_url;
JAVA调用演示:
public static void main(String path[]) throws Exception {
URL u = new URL("http://www.maoapi.cn/wxymjc?url_long?url_long=http://www.baidu.com");
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调用演示:
import urllib, urllib2, sys
host = 'http://www.maoapi.cn'
path = '/wxymjc?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)
到此,相信大家对“微信域名拦截查询的方法有哪些”有了更深的了解,不妨来实际操作一番吧!这里是亿速云网站,更多相关内容可以进入相关频道进行查询,关注我们,继续学习!
亿速云「云服务器」,即开即用、新一代英特尔至强铂金CPU、三副本存储NVMe SSD云盘,价格低至29元/月。点击查看>>
免责声明:本站发布的内容(图片、视频和文字)以原创、转载和分享为主,文章观点不代表本网站立场,如果涉及侵权请联系站长邮箱:is@yisu.com进行举报,并提供相关证据,一经查实,将立刻删除涉嫌侵权内容。
原文链接:http://blog.itpub.net/69965523/viewspace-2678644/