当前位置:网站首页>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文件中也会经常遇到这种问题,吃一堑长一智~
边栏推荐
- PHP算法之最接近的三数之和
- excel remove all carriage return from a cell
- 关于ETL的两种架构(ETL架构和ELT架构)
- 从0到1:图文投票小程序设计与研发笔记
- Wechat Gymnasium Reservation Mini Program Graduation Design Finished Work Mini Program Graduation Design Finished Product (2) Mini Program Function
- 牛客多校4 A.Task Computing 思维
- How to use pywinauto and pyautogui to link the anime lady and sister please go home
- 得物客服热线的演进之路
- 毫秒级!千万人脸库快速比对,上亿商品图片检索,背后的极速检索用了什么神器?
- 一种灵活的智能合约协作方式
猜你喜欢

2022 edition of MySQL tutorial, top collection good, take your time

小程序容器+自定义插件,可实现混合App快速开发

小程序毕设作品之微信美食菜谱小程序毕业设计成品(8)毕业设计论文模板

深度学习Course2第二周Optimization Algorithms习题整理

User Experience | How to Measure User Experience?

10年稳定性保障经验总结,故障复盘要回答哪三大关键问题?|TakinTalks大咖分享

从0到1:图文投票小程序设计与研发笔记

03. GO language variable definition, function

Small application project works WeChat stadium booking applet graduation design of the finished product (1) the development profile

System availability: 3 9s, 4 9s in SRE's mouth... What is it?
随机推荐
RxJs SwitchMapTo 操作符之移花接木
excel vertical to horizontal
excel edit a cell without double clicking
A. Doremy‘s IQ-- Codeforces Round #808 (Div. 1)
罗克韦尔AB PLC RSLogix5000中的比较指令使用方法介绍
Prufer sequence
leetcode 204. Count Primes 计数质数 (Easy)
excel split text into different rows
小程序容器+自定义插件,可实现混合App快速开发
PHP算法之有效的括号
1391D. 505 状压dp
vscode hide menu bar
excel cell contian two words, seperated by a slash
Advanced Algebra_Proof_The algebraic multiplicity of any eigenvalue of a matrix is greater than or equal to its geometric multiplicity
小程序毕设作品之微信体育馆预约小程序毕业设计成品(4)开题报告
B. Difference Array--Codeforces Round #808 (Div. 1)
深度学习Course2第二周Optimization Algorithms习题整理
Codeforces CodeTON Round 2 (Div. 1 + Div. 2, Rated, Prizes!) A-D Solution
Quarantine and downgrade
From 0 to 100: Notes on the Development of Enrollment Registration Mini Programs