当前位置:网站首页>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
边栏推荐
- Visual studio 2019 (localdb) \mssqllocaldb SQL Server 2014 database version is 852 and cannot be opened. This server supports version 782 and earlier
- 利用栈来实现二进制转化为十进制
- 2022危险化学品生产单位安全生产管理人员考题及在线模拟考试
- Customize the web service configuration file
- GCC compilation error
- Tutorial on principles and applications of database system (007) -- related concepts of database
- Sign up now | oar hacker marathon phase III midsummer debut, waiting for you to challenge
- 免备案服务器会影响网站排名和权重吗?
- 平安证券手机行开户安全吗?
- BGP third experiment report
猜你喜欢

Vxlan static centralized gateway
![[pytorch practice] image description -- let neural network read pictures and tell stories](/img/39/b2c61ae0668507f50426b01f2deee4.png)
[pytorch practice] image description -- let neural network read pictures and tell stories

Sort out the garbage collection of JVM, and don't involve high-quality things such as performance tuning for the time being

The left-hand side of an assignment expression may not be an optional property access.ts(2779)

IPv6 experiment

Tutorial on the principle and application of database system (011) -- relational database

SQL lab 26~31 summary (subsequent continuous update) (including parameter pollution explanation)
![[deep learning] image multi label classification task, Baidu paddleclas](/img/dd/6f213a396e8bb240a6872e4c03afab.png)
[deep learning] image multi label classification task, Baidu paddleclas

"Series after reading" my God! It's so simple to understand throttling and anti shake~

数据库系统原理与应用教程(010)—— 概念模型与数据模型练习题
随机推荐
Attack and defense world ----- summary of web knowledge points
Pule frog small 5D movie equipment | 5D movie dynamic movie experience hall | VR scenic area cinema equipment
Upgrade from a tool to a solution, and the new site with praise points to new value
DOM parsing XML error: content is not allowed in Prolog
解决 Server returns invalid timezone. Go to ‘Advanced’ tab and set ‘serverTimezone’ property manually
【统计学习方法】学习笔记——支持向量机(下)
An error occurred when vscade tried to create a file in the target directory: access denied [resolved]
编译 libssl 报错
Preorder, inorder and postorder traversal of binary tree
BGP third experiment report
Customize the web service configuration file
Unity map auto match material tool map auto add to shader tool shader match map tool map made by substance painter auto match shader tool
2022危险化学品生产单位安全生产管理人员考题及在线模拟考试
千人规模互联网公司研发效能成功之路
Object. Simple implementation of assign()
Using stack to convert binary to decimal
利用栈来实现二进制转化为十进制
Idea 2021 Chinese garbled code
Routing strategy of multi-point republication [Huawei]
2022A特种设备相关管理(锅炉压力容器压力管道)模拟考试题库模拟考试平台操作