当前位置:网站首页>Charles uses three ways to modify requests and responses
Charles uses three ways to modify requests and responses
2022-04-23 03:12:00 【A happy wild pointer D】
1. Breaking point
(1) First, execute it manually , Let the request appear in charles In the conversation list on the left .
We want to check that the material name contains “ masks ” Material information .
(2) Select the session , Right click , choice Breakpoints
(3) Refresh the page , At this time, the browser sends a request , It stopped charles Agent here , It hasn't been sent to the server yet .
After refreshing, the browser interface will automatically jump to charles In the interface , Click on Edit Request You can modify the request parameters . Click... Below after modification Execute, Send a request to .
(4) After receiving the response from the server , Click on Edit Response, Modify the response content , Click again on the Execute, Return the response to the browser .
(5) The browser displays the returned data .
Here you can see , We wanted to check “ masks ” Of information , By modifying the parameters of the request , The server returned to us “ The thermometer ” Information about .
2.Map Local
(1)Tools→Map Local , Click on Add
Or you can directly select the session , Right click , choice Map Local. Open the page in this way host、port It has been filled in automatically .
(2) Fill in Map From The agreement 、host、port、path etc.
(3) Select local file as response return . You can copy the response information to json In file , Or right click →Save Response.... Save to local , Then modify it according to your own needs .
(4) Go to the browser and make a request .
Once you set it up , The response content of all qualified requests will be replaced with the configured local file .
You can see , I'm looking for monitoring materials now , But it shows what I just specified json Contents of the file .
3.Map Remote
(1)Tools→Map Remote, Check Enable Map Remote, Click on Add, add mapping
(2) Prepare the data
stay fastmock The platform creates an interface , Return the information of login failure . In this way, whether the login name is correct or not , Are prompted by login errors , Unable to log in to the home page .
(3) Initiate request
You can see ,mms Your login request is mapped to mock The interface of
版权声明
本文为[A happy wild pointer D]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/04/202204220627538103.html
边栏推荐
- 搭建XAMPP时mysql端口被占用
- xutils3修改了我提报的一个bug,开心
- ASP. Net 6 middleware series - execution sequence
- 《C语言程序设计》(谭浩强第五版) 第8章 善于利用指针 习题解析与答案
- Using stack to solve the problem of "mini parser"
- 微软是如何解决 PC 端程序多开问题的
- Test experience data
- Laravel's own paging query
- [MySQL] left function | right function
- The most understandable life cycle of dependency injection
猜你喜欢
“如何实现集中管理、灵活高效的CI/CD”在线研讨会精彩内容分享
Vs code setting line feed
Configure automatic implementation of curd projects
宁德时代地位不保?
2022 P cylinder filling training test questions and simulation test
Tips in MATLAB
Laravel8- use JWT
The most easy to understand dependency injection and control inversion
12.<tag-链表和常考点综合>-lt.234-回文链表
Blazor University (11) component - replace attributes of subcomponents
随机推荐
OLED multi-level menu record
【新版发布】ComponentOne 新增 .NET 6 和 Blazor 平台控件支持
Xutils3 corrected a bug I reported. Happy
OLED多级菜单记录
Flink实时数仓项目—DWS层设计与实现
Recommend reading | share the trader's book list and ask famous experts for trading advice. The trading is wonderful
First in the binary tree
ASP. Net 6 middleware series - Custom middleware classes
Two methods are used to solve the "maximum palindrome product" problem
软件测试相关知识~
Distributed system services
利用栈的回溯来解决“文件的最长绝对路径”问题
TP5 inherits base and uses the variables in base
Blazor University (11)组件 — 替换子组件的属性
2022G2电站锅炉司炉考试题库及在线模拟考试
Using stack to solve the problem of "mini parser"
Source code interpretation of Flink index parameters (read quantity, sent quantity, sent bytes, received bytes, etc.)
This new feature of C 11, I would like to call it the strongest!
TP5 where query one field is not equal to multiple values
ASP. Net 6 middleware series - execution sequence