当前位置:网站首页>Charles: four ways to modify the input parameters or return results of the interface
Charles: four ways to modify the input parameters or return results of the interface
2022-07-07 12:35:00 【Xiaoding Chong duck!】
Preface :
charles It is a commonly used packet capturing tool in development , It's very powerful , Among them, those who can directly modify the request are 4 Methods , Namely :map Local、map Remote、Rewrite and Breakpoints.
One 、 map Local
1. effect
Will match url Map to local file
2. Applicable scenario
(1) You need to constantly modify the returned results of the interface to test various case
(2) When the back end of a requested return result is difficult to simulate
3. step
(1) Save the response result of the request : Right click on the request save Response, Save the original message locally
(2) Map the request to the file : Right click on the request Map local
Map the request to your local file
(3) According to the demand , Modify the local file and save , When the interface is requested again , You will see that the returned result has been changed to the local file we mapped
Two 、 map Remote
1. effect
Remote mapping , That is, map the domain name you want to request to another remote domain name . Usually used to switch environments ,
2. Applicable scenario
(1) Switch the interface of the test environment to the online environment
(2) Protocol conversion , If you put https become http
3. step
(1) After selecting the request , Right click on the Map Remote
(2) Modify the mapping address information according to the situation
(3) Refresh the page and re request , You will find that the request has been mapped to the modified new address
3、 ... and 、 Rewrite
1. effect
For matching url, Regular substitution request or response All kinds of values , Include header、host、url、path、query param、response status、body
2. Applicable scenario
(1) Modify the input parameters of the request 、header Medium parameters and other scenarios
3. step
(1) Click on Tools → Click on Rewrite
(2) Check Enable Rewrite, Click on add, Add the request that needs to be rewritten url Information
(3) Click on the bottom right corner add Add fields that need to be rewritten
(4) Refresh the page and re request , You will find that the modified field has been rewritten
Four 、 Breakpoints
1. effect
Yes url Breaking point , Interrupts Request or Response, When pausing, you can modify the request data or response results
2. Applicable scenario
(1) Every request needs to be modified Request or Response Of header、 Enter the reference 、 Return partial values of results, etc
3. step
(1) Right click on the request Breakpoints, That is, open the breakpoint ( The default is Request and Response, Can be found in Breakpoint Settings Revision in China )
(2) Breakpoints can be modified Request or Response Value
(3) Click Execute, After continuing to execute, you can see that the modification takes effect
边栏推荐
- SQL Lab (41~45) (continuous update later)
- Session
- Vxlan static centralized gateway
- SQL Lab (46~53) (continuous update later) order by injection
- leetcode刷题:二叉树24(二叉树的最近公共祖先)
- EPP+DIS学习之路(2)——Blink!闪烁!
- SQL Lab (36~40) includes stack injection, MySQL_ real_ escape_ The difference between string and addslashes (continuous update after)
- 平安证券手机行开户安全吗?
- Xiaohongshu microservice framework and governance and other cloud native business architecture evolution cases
- How to use PS link layer and shortcut keys, and how to do PS layer link
猜你喜欢
Pule frog small 5D movie equipment | 5D movie dynamic movie experience hall | VR scenic area cinema equipment
Session
2022A特种设备相关管理(锅炉压力容器压力管道)模拟考试题库模拟考试平台操作
leetcode刷题:二叉树22(二叉搜索树的最小绝对差)
Aike AI frontier promotion (7.7)
全球首堆“玲龙一号”反应堆厂房钢制安全壳上部筒体吊装成功
EPP+DIS学习之路(2)——Blink!闪烁!
Sign up now | oar hacker marathon phase III midsummer debut, waiting for you to challenge
IPv6 experiment
《看完就懂系列》天哪!搞懂节流与防抖竟简单如斯~
随机推荐
浅谈估值模型 (二): PE指标II——PE Band
An error occurred when vscade tried to create a file in the target directory: access denied [resolved]
About web content security policy directive some test cases specified through meta elements
[play RT thread] RT thread Studio - key control motor forward and reverse rotation, buzzer
SQL lab 21~25 summary (subsequent continuous update) (including secondary injection explanation)
SQL blind injection (WEB penetration)
H3C HCl MPLS layer 2 dedicated line experiment
即刻报名|飞桨黑客马拉松第三期盛夏登场,等你挑战
@What happens if bean and @component are used on the same class?
Realize a simple version of array by yourself from
SQL lab 1~10 summary (subsequent continuous update)
Configure an encrypted web server
ENSP MPLS layer 3 dedicated line
普乐蛙小型5d电影设备|5d电影动感电影体验馆|VR景区影院设备
NGUI-UILabel
【深度学习】图像多标签分类任务,百度PaddleClas
idm服务器响应显示您没有权限下载解决教程
Using stack to convert binary to decimal
PowerShell cs-utf-16le code goes online
BGP actual network configuration