curl在windows下和linux中使用的一个区别 | 您所在的位置:网站首页 › powershell命令和linux命令一样吗 › curl在windows下和linux中使用的一个区别 |
最近在windows环境下的cmd中,使用curl测试post接口,总是报Failed to decode JSON object的错误。
同样的命令在windows环境的git bash窗口中执行是好的。git bash可以模拟linux环境下一些命令的输入效果。 特别是scp命令给linux上传文件,或者从linux上下载文件件时很方便。
windows环境中,curl命令中的双引号需要使用"\"来进行转义。 例如,curl -v 127.0.0.1://test/pools -X POST -H "Content-Type: application/json" -d '{"message":"test"}' 要加上转义: curl -v 127.0.0.1://test/pools -X POST -H "Content-Type: application/json" -d '{\"message\":\"tes\t"}'
|
CopyRight 2018-2019 实验室设备网 版权所有 |