Search code examples
c#proxyresponsefiddlercore

FiddlerCore insert image inside site (change response)?


What i need is to change original response which i get from some site (example http://www.google.com) by using FiddlerCore.

I think that can be accomplish by using proxy.

For example i will like to insert some button or image inside web page (http://www.google.com), for that i use fiddlercore library in c#. Is there any script example of how to do that. Any links, will be appreciate.


Solution

  • Use FiddlerApplication.BeforeResponse event. The FiddlerCoreAPI SampleApp subscribes to this event by using an anonymous method (the code is commented out). However, the sample method code is too simple.

    You should be able to read the reponse body using Fiddler.Session.ResponseBody getter or GetResponseBodyAsString(). Use utilDecodeResponse() to decode it first. Tamper it and store it back using Fiddler.Session.ResponseBody setter or utilSetResponseBody().