unable to change response body

7 posts, 0 answers
  1. Alex
    Alex avatar
    4 posts
    Member since:
    Oct 2015

    Posted 13 Oct 2015 Link to this post

    static function OnBeforeResponse(oSession: Session) {
            if (oSession.uriContains("google.com")) {
                FiddlerApplication.Log.LogString("before "+oSession.GetResponseBodyAsString());
                oSession.utilSetResponseBody("empty");
                FiddlerApplication.Log.LogString("after "+oSession.GetResponseBodyAsString());
            }
        }

     

    hi.

    i am trying to chage response body from third party website.

    in fiddler log i see that response body is changed, but browser receives unchanged response body.

    can anybody to help me with my issue?

  2. Eric Lawrence
    Admin
    Eric Lawrence avatar
    832 posts

    Posted 13 Oct 2015 Link to this post

    In 99% of the cases where someone reports this issue it turns out that they've configured the response body to stream to the client as it is read from the server (e.g. by pushing the STREAM button in Fiddler's toolbar). When that happens, the client is fed the blocks of the response as it is downloaded, and the event handler mentioned only executes after the response has already been returned.

    If you disable Streaming, it should work as you expect.

    Regards,
    Eric Lawrence
    Telerik
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
  3. Alex
    Alex avatar
    4 posts
    Member since:
    Oct 2015

    Posted 13 Oct 2015 in reply to Eric Lawrence Link to this post

    oh, thanks, that is works
  4. Alex
    Alex avatar
    4 posts
    Member since:
    Oct 2015

    Posted 13 Oct 2015 in reply to Eric Lawrence Link to this post

    but i have another issue:

    i cannot access some sites with fiddler certificate, i got sec_error_unknown_issuer

    particularly in mozilla a dont have an option to add security exception.

  5. Eric Lawrence
    Admin
    Eric Lawrence avatar
    832 posts

    Posted 14 Oct 2015 Link to this post

    Hi,

    For browsers like IE and Chrome to trust Fiddler's root certificate, you must accept the prompt that is shown when you first enable HTTPS decryption inside Fiddler.

    For Firefox, which does not respect the Windows Certificate store, you must manually trust Fiddler's root certificate: http://www.telerik.com/blogs/configuring-firefox-for-fiddler

    Regards,
    Eric Lawrence
    Telerik
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
  6. poorna
    poorna avatar
    1 posts
    Member since:
    May 2018

    Posted 23 May Link to this post

    Hi 

    I have saved my working response   usingbefore response and the complete response is saved to fiddler captures folder

     

    Now  the task is I want to send this captured response back to the client, I have tried this by using utilsendresponse and loadresponsefromfile etc but I am not able to send my captured response to client. I have disabled streaming as well. Kindy help how can I sendthis dummy response to client

  7. Kammen
    Admin
    Kammen avatar
    328 posts

    Posted 29 May Link to this post

    Hi,

    Have you tried to use the AutoResponder feature of Fiddler?

    In this blogpost you can find how to use it to change the response to the client. Can you give it a try and see if this is what you're looking for?


    Regards,
    Kammen
    Progress Telerik
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
Back to Top