HTML转义
HTML特殊字符转义与反转义
GET
https://api.tinyaii.cn/v1/html/escape
请求参数
| 参数名 | 类型 | 必填 | 说明 | 示例 |
|---|---|---|---|---|
| text | string | 必填 | 输入文本 | <div>hello</div> |
| mode | string | 可选 | escape/unescape | escape |
返回字段
| 字段 | 类型 | 说明 |
|---|---|---|
| output | string | 转换结果 |
返回示例
{
"code": 200,
"data": {
"mode": "escape",
"input": "<div>hello</div>",
"output": "<div>hello</div>"
}
}
调用示例
curl "https://api.tinyaii.cn/v1/html/escape?text=<div>hello</div>" \
-H "Authorization: Bearer YOUR_API_KEY"const res = await fetch("https://api.tinyaii.cn/v1/html/escape?text=<div>hello</div>", {
headers: { "Authorization": "Bearer YOUR_API_KEY" },
});
console.log(await res.json());import requests
resp = requests.get(
"https://api.tinyaii.cn/v1/html/escape",
params={"text": "<div>hello</div>"},
headers={"Authorization": "Bearer YOUR_API_KEY"},
timeout=10,
)
print(resp.json())把 YOUR_API_KEY 换成你的密钥即可直接运行。密钥只保存在你自己的设备上。