温馨提示×

温馨提示×

您好,登录后才能下订单哦!

密码登录×
登录注册×
其他方式登录
点击 登录注册 即表示同意《亿速云用户服务条款》

微信短网址 微信短网址(url.cn)在线生成接口

发布时间:2020-08-05 04:47:54 来源:ITPUB博客 阅读:282 作者:故乡的云 栏目:移动开发

简要描述:

  • 微信短网址url.cn链接生成 

  • 微信短网址的应用场景很广,譬如短信营销、邮件推广、微信营销、QQ营销、自媒体推广、渠道推广等,都会用到短网址。究其原因是在于短网址可以降低推广成本、...
           

请求URL:

http://maiyurl.cn/tengxurl?url_long=http://www.baidu.com

http://www.sinadwz.cn/urlcn/api?url_long=http://www.baidu.com

http://www.qqdwz.cn/urlcn/api?url_long=http://www.baidu.com

请求方式:

  • GET

参数:

参数名

必选

类型

说明

url

string

需要缩短的链接

请求示例

  • http://maiyurl.cn/tengxurl?url_long=http://www.baidu.com

返回示例

{"short_url": "https://url.cn/54R8NCd","long_url": "https://www.baidu.com/s?ie=UTF-8&wd=api"}

返回参数说明

参数名

类型

说明

short_url

string

缩短后的链接

long_url

string

原长链接

请求示例

1、PHP请求示例:

$url = 'http://www.baidu.com';
$api_url = ' http://maiyurl.cn/weixin/short?link=http://www.baidu.com;
$short_url = file_get_contents($api_url);
echo $short_url;

2、Java请求示例:

public static void main(String path[]) throws Exception {
URL u = new URL(" http://maiyurl.cn/weixin/short?link=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"));
}

3、Python请求示例:

import urllib, urllib2, sys
host = ' http://maiyurl.cn'
path = '/weixin/short'
method = 'GET'
querys = 'link=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)



备注

  • 更多接口请访问API接口官网

  • http://maiyurl.cn        

向AI问一下细节

免责声明:本站发布的内容(图片、视频和文字)以原创、转载和分享为主,文章观点不代表本网站立场,如果涉及侵权请联系站长邮箱:is@yisu.com进行举报,并提供相关证据,一经查实,将立刻删除涉嫌侵权内容。

AI