Is it possible to rewrite a status code with Charles Proxy?

后端 未结 6 820
刺人心
刺人心 2021-01-30 15:57

I\'m using Charles Proxy to rewrite a response from an API for testing purpose.

If I set a breakpoint, I am allowed to completely rewrite the raw response as I wish.

6条回答
  •  被撕碎了的回忆
    2021-01-30 16:40

    Final Edit: Marc Liyanage's answer is the most correct for this question now.

    No, you're not, I don't think it is possible to rewrite a status code.

    I cannot add this as a comment (new user) but one workaround is:

    1. Create resources on a server that will return the codes you need, or find ones that do.
    2. Use the Map Remote feature, mapping to the resource that returns the code.

    I've tried using Map Local, which would be perfect for this, but Charles adds it's own 200 OK status code to all files returned.

    Edit: Also you can use breakpoints on individual responses and modify the code.

提交回复
热议问题