curl - curl - 带有反斜杠的参数不通过
问题描述
在 Windows 环境中工作
我可以用 wget 执行这个命令,它可以工作:
wget --method GET "http://localhost/command?folderSource=\\myshare\myfolder&folderDestination=\\myshare\myfolder"
但是下面的 curl 命令在服务器上给出了一个错误:java.lang.IllegalArgumentException: Invalid character found in the request target。有效字符在 RFC 7230 和 RFC 3986 中定义
curl --request GET "http://localhost:8090/command?folderSource=\\myshare\myfolder&folderDestination=\\myshare\myfolder"
我已将其范围缩小到具有反斜杠的参数......没有反斜杠,服务器可以很好地接收两个参数。我试过用额外的反斜杠转义反斜杠......我试过添加一个,两个和三个,,,,没有运气。我也尝试过对参数值进行 URL 编码,但没有成功。非常感谢有关如何在 Windows 上通过 curl 传递包含反斜杠的参数的帮助
解决方案
谢谢,这让我发现使用参数 --data-urlencode,它有效!
推荐阅读
- javascript - YayraBox 数据表 JavaScript CDN 与 Laravel 冲突
- android - Android MVVM,你能用另一个 LiveData 对象观察 ViewModel 中的 LiveData 吗?
- django - 在graphene-django中按主键查找(带中继)
- datastax - DSE 模式创建:节点工作负载不兼容
- python - sqlalchemy:我无法从表中删除记录 - 违反非空约束
- google-apps-script - 从工作表更新表单的问题
- azure - 是否可以通过 KeyCloak 为一组 webapp 配置 2 个不同的 SSO (AD)?
- kubernetes - Prometheus:公开 kubernetes pod 特定指标
- wordpress - 安装 Gon WordPress 主题时出错
- python-imaging-library - 我如何使用 Python Pillow 将图片粘贴到另一个图层(所以没有 PNG 网格)