当前位置:网站首页>bat 之 特殊字符&转义
bat 之 特殊字符&转义
2022-08-01 22:57:00 【紫火桑葚】
先看例子
curl -H "Content-Type:application/json"
-X POST
-d "{\"value\":\"type=username&username=xxxx0001\"}"
http://127.0.0.1:8111/loginbyother
//以上命令是为了方便看代码而换行,实际是一整行
在Windows Terminal中执行上面的语句,会一直报错
curl: no URL specified!
curl: try 'curl --help' for more information
一直以为是引号的问题,于是换各种方式对引号进行转义,甚至还用上UrlEncode方式,但都没效果,最终确定,是 & 号的问题,因为在windows中,&表示指令连接,所以必须进行转义。
& 转义 ====> ^&
于是修改代码如下
curl -H "Content-Type:application/json"
-X POST
-d "{\"value\":\"type=username^&username=xxxx0001\"}"
http://127.0.0.1:8111/loginbyother
//以上命令是为了方便看代码而换行,实际是一整行
bat文件中也会经常遇到这种问题,吃一堑长一智~
边栏推荐
- Use Jenkins for continuous integration, this knowledge point must be mastered
- excel vertical to horizontal
- [ASM] Bytecode Operation MethodWriter
- How to use pywinauto and pyautogui to link the anime lady and sister please go home
- 小程序毕设作品之微信体育馆预约小程序毕业设计成品(2)小程序功能
- 46.全排列
- 得物客服热线的演进之路
- 如何理解 new (...args: any[]) => any
- 华为无线设备配置双链路冷备份(AP指定配置方式)
- AQS
猜你喜欢
牛客多校4 A.Task Computing 思维
E - Integer Sequence Fair
小程序毕设作品之微信美食菜谱小程序毕业设计成品(8)毕业设计论文模板
Wechat Gymnasium Appointment Mini Program Graduation Design Finished Work (4) Opening Report
Advanced Algebra_Proof_The algebraic multiplicity of any eigenvalue of a matrix is greater than or equal to its geometric multiplicity
(翻译)按钮的对比色引导用户操作的方式
联邦学习的框架搭建
PHP算法之电话号码的字母组合
SOM Network 2: Implementation of the Code
When solving yolov5 training: "AssertionError: train: No labels in VOCData/dataSet_path/train.cache. Can not train"
随机推荐
Background project Express-Mysql-Vue3-TS-Pinia page layout-sidebar menu
2022/7/31
When solving yolov5 training: "AssertionError: train: No labels in VOCData/dataSet_path/train.cache. Can not train"
familiar friend
03. GO language variable definition, function
用virtualenv和Virtualenvwrapper虚拟环境管理工具创建虚拟环境
深度学习Course2第二周Optimization Algorithms习题整理
小程序毕设作品之微信美食菜谱小程序毕业设计成品(5)任务书
从0到1:图文投票小程序设计与研发笔记
excel change cell size
excel remove all carriage return from a cell
编曲软件FL studio20.8中文版功能和作用
SAP Spartacus NgExpressEngineDecorator 的工作原理
字符串——Trie
A. Doremy‘s IQ-- Codeforces Round #808 (Div. 1)
AQS
移动端人脸风格化技术的应用
seaborn笔记:可视化统计关系(散点图、折线图)
PAM 回文自动机
域名重定向工具 —— SwitchHosts 实用教程