全球主机交流论坛
标题:
curl post 里面的 + 加号怎么不转义输出啊
[打印本页]
作者:
toyst
时间:
2021-11-12 13:37
标题:
curl post 里面的 + 加号怎么不转义输出啊
oldPath="ABC+ABC"
curl -G --data--urlencode "oldPath=$oldPath" www.abc.com
复制代码
传过去报错 oldPath "ABC ABC" 不存在
"+" 变成了空格
作者:
directlinkss
时间:
2021-11-12 13:58
url编码。
作者:
directlinkss
时间:
2021-11-12 13:59
ABC%2BABC
作者:
0048eca662ab154
时间:
2021-11-12 16:35
本帖最后由 0048eca662ab154 于 2021-11-12 16:37 编辑
没有问题吧?你加上-v检查下
作者:
toyst
时间:
2021-11-12 16:51
0048eca662ab154 发表于 2021-11-12 16:35
没有问题吧?你加上-v检查下
* Trying 127.0.0.1:12345...
* TCP_NODELAY set
* Connected to 127.0.0.1 (127.0.0.1) port 12345 (#0)
> POST /api/v2/torrents/renameFile HTTP/1.1
> Host: 127.0.0.1:12345
> User-Agent: curl/7.68.0
> Accept: */*
> Cookie: SID=37qv44bvLPGK+9QMl5rmv/aNPNnaTqSYa
> Content-Length: 307
> Content-Type: application/x-www-form-urlencoded
>
* upload completely sent off: 307 out of 307 bytes
* Mark bundle as not supporting multiuse
< HTTP/1.1 409 Conflict
< connection: keep-alive
< content-length: 159
< content-security-policy: default-src 'self'; style-src 'self' 'unsafe-inline'; img-src 'self' data:; script-src 'self' 'unsafe-inline'; object-src 'none'; form-action 'self';
< content-type: text/plain; charset=UTF-8
< date: Fri, 12 Nov 2021 08:50:10 GMT
< referrer-policy: same-origin
< x-content-type-options: nosniff
< x-xss-protection: 1; mode=block
<
* Connection #0 to host 127.0.0.1 left intact
作者:
qshng
时间:
2021-11-12 16:53
关注,加号不会是代表加一个同名的参数吧
作者:
所長
时间:
2021-11-12 16:53
https://tool.chinaz.com/tools/urlencode.aspx
作者:
toyst
时间:
2021-11-12 16:59
qshng 发表于 2021-11-12 16:53
关注,加号不会是代表加一个同名的参数吧
不是,直接给我替换成空格了
作者:
ezreal
时间:
2021-11-12 17:28
%2B
欢迎光临 全球主机交流论坛 (https://hostloc.9hanju.com/)
Powered by Discuz! X3.4