短链-短网址生成


加载中...

开放Api

获取短网址

url

https://dll.im/url/generate

POST application/x-www-form-urlencoded

request

入参 描述 类型
url 完整网址url,如:https://dll.im String

response

{
    "success":true,
    "data":{
        "originUrl":"https://www.wrbug.com",
        "shortHash":"NRFb",
        "shortUrl":"https://dll.im/NRFb"
    },
    "msg":""
}
OkHttpClient client = new OkHttpClient().newBuilder()
  .build();
MediaType mediaType = MediaType.parse("application/x-www-form-urlencoded");
RequestBody body = RequestBody.create(mediaType, "url=https://dll.im");
Request request = new Request.Builder()
  .url("https://dll.im/url/generate")
  .method("POST", body)
  .addHeader("Content-Type", "application/x-www-form-urlencoded")
  .build();
Response response = client.newCall(request).execute();
var settings = {
  "url": "https://dll.im/url/generate",
  "method": "POST",
  "timeout": 0,
  "headers": {
    "Content-Type": "application/x-www-form-urlencoded"
  },
  "data": {
    "url": "https://dll.im"
  }
};

$.ajax(settings).done(function (response) {
  console.log(response);
});
curl --location --request POST 'https://dll.im/url/generate' \
--header 'Content-Type: application/x-www-form-urlencoded' \
--data-urlencode 'url=https://dll.im'
import requests
url = "https://dll.im/url/generate"
payload = 'url=https%3A//dll.im'
headers = {
  'Content-Type': 'application/x-www-form-urlencoded'
}
response = requests.request("POST", url, headers=headers, data = payload)
print(response.text.encode('utf8'))


Copyright © 2018 慢啄网.蜀ICP备14018823号