GET
文本工具
URL 编解码
把文本做 URL 编码,或把 %xx 还原成原文。
累计调用 9
今日调用 0
更新于 2026-10-16
调用地址
GET
https://itapi.top/api/urlcode
请求参数
| 参数名 | 类型 | 必填 | 说明 | 示例 |
|---|---|---|---|---|
| text | string | 必填 | 要处理的文本 | 测试文本 |
| mode | string | 可选 | encode 编码 / decode 解码 | 暂无 |
返回字段
| 字段名 | 类型 | 说明 |
|---|---|---|
| code | int | 状态码 |
| data.output | string | 处理结果 |
| data.mode | string | 使用的模式 |
响应示例
200 OK
{"code":200,"msg":"success","data":{"input":"测试文本","mode":"encode","output":"%E6%B5%8B%E8%AF%95%E6%96%87%E6%9C%AC","output2":"%E6%B5%8B%E8%AF%95%E6%96%87%E6%9C%AC"}}
在线测试
代码示例
cURL · GET
curl "https://itapi.top/api/urlcode?text=%E6%B5%8B%E8%AF%95%E6%96%87%E6%9C%AC&mode=%E6%9A%82%E6%97%A0"
PHP
<?php
$res = file_get_contents("https://itapi.top/api/urlcode?text=%E6%B5%8B%E8%AF%95%E6%96%87%E6%9C%AC&mode=%E6%9A%82%E6%97%A0");
$json = json_decode($res, true);
print_r($json);
JavaScript
const res = await fetch("https://itapi.top/api/urlcode?text=%E6%B5%8B%E8%AF%95%E6%96%87%E6%9C%AC&mode=%E6%9A%82%E6%97%A0");
const json = await res.json();
console.log(json);
Python
import requests
r = requests.get("https://itapi.top/api/urlcode?text=%E6%B5%8B%E8%AF%95%E6%96%87%E6%9C%AC&mode=%E6%9A%82%E6%97%A0", timeout=10)
print(r.json())