当前位置:网站首页>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
边栏推荐
- Xiaohongshu microservice framework and governance and other cloud native business architecture evolution cases
- 开发一个小程序商城需要多少钱?
- Dialogue with Wang Wenyu, co-founder of ppio: integrate edge computing resources and explore more audio and video service scenarios
- 【PyTorch实战】用RNN写诗
- "Series after reading" my God! It's so simple to understand throttling and anti shake~
- GCC compilation error
- File upload vulnerability - upload labs (1~2)
- idm服务器响应显示您没有权限下载解决教程
- Simple network configuration for equipment management
- How much does it cost to develop a small program mall?
猜你喜欢

leetcode刷题:二叉树23(二叉搜索树中的众数)

<No. 9> 1805. Number of different integers in the string (simple)

EPP+DIS学习之路(1)——Hello world!

MPLS experiment

wallys/Qualcomm IPQ8072A networking SBC supports dual 10GbE, WiFi 6

盘点JS判断空对象的几大方法

Static comprehensive experiment

leetcode刷题:二叉树20(二叉搜索树中的搜索)

2022广东省安全员A证第三批(主要负责人)考试练习题及模拟考试

idm服务器响应显示您没有权限下载解决教程
随机推荐
About web content security policy directive some test cases specified through meta elements
EPP+DIS学习之路(2)——Blink!闪烁!
即刻报名|飞桨黑客马拉松第三期盛夏登场,等你挑战
leetcode刷题:二叉树25(二叉搜索树的最近公共祖先)
开发一个小程序商城需要多少钱?
Attack and defense world - PWN learning notes
Ctfhub -web SSRF summary (excluding fastcgi and redI) super detailed
Simple network configuration for equipment management
Upgrade from a tool to a solution, and the new site with praise points to new value
NGUI-UILabel
【二叉树】删点成林
【统计学习方法】学习笔记——逻辑斯谛回归和最大熵模型
Static routing assignment of network reachable and telent connections
Cookie
leetcode刷题:二叉树26(二叉搜索树中的插入操作)
Visual studio 2019 (localdb) \mssqllocaldb SQL Server 2014 database version is 852 and cannot be opened. This server supports version 782 and earlier
牛客网刷题网址
ps链接图层的使用方法和快捷键,ps图层链接怎么做的
Experiment with a web server that configures its own content
SQL injection -- Audit of PHP source code (take SQL lab 1~15 as an example) (super detailed)