cURL
curl "https://api.ruseo.cn/api/urlencode?text=Hello+World&action=encode&standard=legacy&encoding=UTF-8"
URL编码解码工具,将特殊字符和中文转为UrlEncode格式。支持两种标准:legacy(空格→+)和RFC3986(空格→%20)。自动检测编码/解码操作,同时返回两种标准结果供对比
https://api.ruseo.cn/api/urlencode
接口调用前需要确认的核心配置。
/api/urlencodeurlencode必填参数必须传入,示例值可直接用于联调。
免费API不强制要求API Key,但如果您希望统计个人调用次数,请在请求时附加参数 key=您的API_KEY。
注册账号后即可获得API Key。
| 参数名 | 必填 | 类型 | 说明 | 示例值 |
|---|---|---|---|---|
key |
否 | string | 可选参数:携带此参数可统计您的个人调用次数。请注册账号获取API Key。 | YOUR_API_KEY |
text |
是 | string | 要编码/解码的文本 | Hello World |
action |
否 | string | encode/decode/auto默认auto自动检测 | encode |
standard |
否 | string | legacy/rfc3986默认legacy空格变+ | legacy |
encoding |
否 | string | 编码UTF-8/GBK默认UTF-8 | UTF-8 |
优先使用示例地址测试请求参数是否正确。
https://api.ruseo.cn/api/urlencode?text=Hello+World&action=encode&standard=legacy&encoding=UTF-8
curl "https://api.ruseo.cn/api/urlencode?text=Hello+World&action=encode&standard=legacy&encoding=UTF-8"
$url = 'https://api.ruseo.cn/api/urlencode?text=Hello+World&action=encode&standard=legacy&encoding=UTF-8';
$response = file_get_contents($url);
$data = json_decode($response, true);
fetch('https://api.ruseo.cn/api/urlencode?text=Hello+World&action=encode&standard=legacy&encoding=UTF-8')
.then(res => res.json())
.then(data => console.log(data));
实际返回内容以接口脚本处理结果为准。
{
"code": 0,
"msg": "success",
"data": {
"route": "urlencode",
"example": true
}
}
| 参数名 | 类型 | 说明 | 示例值 |
|---|---|---|---|
success |
boolean | 是否成功 | true |
action |
string | 执行的操作 | encode |
input |
string | 输入文本 | |
output |
string | 输出结果 | |
standard |
string | 使用的标准 | legacy |
compare |
object | 两种标准对比 | |
点击左侧“发送请求”查看结果...