'How to change response body with Charles?
I am using Charles (http://www.charlesproxy.com) to debug my HTTP requests and now I run into an issue where I am receiving json response which I need to edit to see how my app behaves.
I was looking at Rewrite option but can't really figure out how to change it. Ideal would be to load whole response from disk.
Any ideas how to accomplish this? Thank you.
Solution 1:[1]
Share how to Enable breakpoints, then change response.
- request the link firstly. then enable breakpoint > in the http request right click > choose Breakpoints
2. Menu Proxy > Breakpoints Settings > double click the request link
3. change the Scheme GET/POST > Query *
4. modify the request, change the tab Edit Request > you can change the URL, Headers, Cookies, etc > then click the Execute
5. edit the response: choose tab Edit Response > change the response > click the Execute
Enjoy it. You make it.
Solution 2:[2]
Charles Proxy change response
As was mentioned Charles Proxy(4.2.8 version) allows you to change response body using different approaches:
- Map Local Tool ? command + ? option + L - Use local files to serve remote location
- Map Remote Tool ? command + ? option + M - Modify the request location to map one remote location to another
- Rewrite Tool ? command + ?option + R - Modify requests and responses as they pass through Charles
- Breakpoints Tool ? command + ? shift + K - Intercept and edit requests and responses before they are sent and received
Read more here
Solution 3:[3]
Enable breakpoints, then change response. You should press continue/send request to send it before tweak response.
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 | Zgpeace |
| Solution 2 | |
| Solution 3 | twlkyao |
