Skip to content
xcsoft edited this page Feb 25, 2022 · 5 revisions

API

POST & GET /api/url

请求参数:

url    原网址 (GET方式请先将原网址进行URL编码)(10~255)
short  自定义短网址 (4~10)
encode 返回方式 (可选json、xml,默认为json)

返回:

json 返回示例

{
    "code": 1001,
    "msg": "url不能为空",
    "url": "",
    "/**/": "失败返回"
}
{
    "code": 0,
    "msg": "success",
    "url": "https://example.com/success",
    "/**/": "成功返回"
}

xml 返回示例

<!-- 失败 -->
<?xml version="1.0" encoding="utf-8"?>
<res>
  <code>-1001</code>
  <msg>url不能为空</msg>
  <url/>
</res>
<!-- 成功 -->
<?xml version="1.0" encoding="utf-8"?>
<res>
  <code>0</code>
  <msg>success</msg>
  <url>https://example.com/success</url>
</res>
Clone this wiki locally