当前位置:网站首页>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 cell contian two words, seperated by a slash
- xss相关知识点以及从 XSS Payload 学习浏览器解码
- From 0 to 1: Design and R&D Notes of Graphic Voting Mini Program
- 将vim与系统剪贴板的交互使用
- JS 数组去重(含简单数组去重、对象数组去重)
- RxJs SwitchMapTo 操作符之移花接木
- xctf attack and defense world web master advanced area webshell
- NgRx Store createSelector 的单步调试和源代码分析
- JS prototype hasOwnProperty in 加方法 原型终点 继承 重写父类方法
猜你喜欢

Codeforces CodeTON Round 2 (Div. 1 + Div. 2, Rated, Prizes!) A-D Solution

Postman batch test interface detailed tutorial

从0到100:招生报名小程序开发笔记

如何给 UE4 场景添加游戏角色

域名重定向工具 —— SwitchHosts 实用教程

文件查询匹配神器 【glob.js】 实用教程

【数据分析03】

img 响应式图片的实现(含srcset属性、sizes属性的使用方法,设备像素比详解)

blender3.2.1 unit setting

Deep Learning Course2 Week 2 Optimization Algorithms Exercises
随机推荐
Wechat Gymnasium Appointment Mini Program Graduation Design Finished Work (4) Opening Report
03、GO语言变量定义、函数
familiar friend
解决yolov5训练时出现:“AssertionError: train: No labels in VOCData/dataSet_path/train.cache. Can not train ”
SOM Network 2: Implementation of the Code
Create virtual environments with virtualenv and Virtualenvwrapper virtual environment management tools
SQL Server(设计数据库--存储过程--触发器)
毫秒级!千万人脸库快速比对,上亿商品图片检索,背后的极速检索用了什么神器?
SQL29 Calculate the average next day retention rate of users
如何理解 new (...args: any[]) => any
[Niu Ke brush questions-SQL big factory interview questions] NO4. Travel scene (a taxi)
Codeforces CodeTON Round 2 (Div. 1 + Div. 2, Rated, Prizes!) A-D 题解
Deep Learning Course2 Week 2 Optimization Algorithms Exercises
Deep learning Course2 first week Practical aspects of Deep Learning exercises
JS prototype hasOwnProperty in 加方法 原型终点 继承 重写父类方法
系统可用性:SRE口中的3个9,4个9...到底是个什么东西?
RxJs SwitchMapTo 操作符之移花接木
From 0 to 1: Design and R&D Notes of Graphic Voting Mini Program
小程序毕设作品之微信体育馆预约小程序毕业设计成品(2)小程序功能
Advanced Algebra_Proof_The algebraic multiplicity of any eigenvalue of a matrix is greater than or equal to its geometric multiplicity