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

后端 未结 6 831
刺人心
刺人心 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条回答
  •  旧时难觅i
    2021-01-30 16:35

    It's not a direct answer to Charles, but you can write JS code to change the HTTP Response at ease with Proxyman (Scripting feature)

    For instance,

    function onResponse(url, request, response) {
        // Change to 404 status code for the matching request
        response.statusCode = 404; 
        return response;
    }
    

    Here is full list of Snippet Code that you can do:

    Disclaimer: I'm a creator of Proxyman. Hope it can help you.

提交回复
热议问题