短域名生成Api及源码

github源码

demo

生成短域名

提交一个长域名生成短域名

Request

Method: POST
URL: http://wkt.ooo/api/short
Headers:

Content-Type: application/json

Body:

{
"long_url":"https://www.baidu.com/s?wd=hellowlrd&rsv......."
}

Response

Body

{
"url":"http://wkt.ooo/f8B6Y"
}

或者选用另外一种方式

cURL (example)

curl -X POST "http://wkt.ooo/api/short" -H "Content-Type: application/json" --data '{"long_url":"http://www.baidu.com"}'       

Response (example)

{"url":"http://wkt.ooo/f8B6Y"}