How to change response body with Charles?

六月ゝ 毕业季﹏ 提交于 2020-01-12 11:49:08

问题


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.


回答1:


The Map Local tool is probably what you're looking for. Access via menu Tools | Map Local.... Note, you may need a corresponding rewrite rule (Tools | Rewrite...) to ensure the mime type of your response served from disk and the type your application is expecting. But recent versions of Charles may set the type automatically.




回答2:


Enable breakpoints, then change response. You should press continue/send request to send it before tweak response.




回答3:


As was mentioned Charles Proxy(4.2.8 version) allows you to change response body using different approaches:

  1. Map Local Tool ⌘ command + ⌥ option + L - Use local files to serve remote location
  2. Map Remote Tool ⌘ command + ⌥ option + M - Modify the request location to map one remote location to another
  3. Rewrite Tool ⌘ command + ⌥option + R - Modify requests and responses as they pass through Charles
  4. Breakpoints Tool ⌘ command + ⇧ shift + K - Intercept and edit requests and responses before they are sent and received

Read more here



来源:https://stackoverflow.com/questions/31681518/how-to-change-response-body-with-charles

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!