FiddlerCore Edit response https not working.

1 Answer 33 Views
Getting started with ASP.NET Miscellaneous
herson
Top achievements
Rank 2
Veteran
herson asked on 30 Dec 2023, 05:08 PM | edited on 31 Dec 2023, 02:45 PM
Hello. I need some help.  I have my website where I want

 

Hi, I need help. I'm using fiddlercore and C# I need to change a response on a website but it doesn't work.

In this case, I have a link that has texts in the response, such as text1 changing to text2,

but nothing happens, the site opens without the changes. Am I missing something? Thank you very much.

private void FiddlerApplication_AfterSessionComplete(Session oSession) { if (oSession.fullUrl.Contains("https:www.mysite/change.json") && oSession.HTTPMethodIs("GET")) { oSession.bBufferResponse = true; oSession.utilDecodeResponse(); AppendTextRichBox2(GetSessionDetails(oSession)); ModifyResponse(oSession, "text1", "text2"); } }

 private void ModifyResponse(Session oSession, string oldValue, string newValue)
        {
            string responseBody = oSession.GetResponseBodyAsString();
            responseBody = responseBody.Replace(oldValue, newValue);
            oSession.utilSetResponseBody(responseBody);
        }

1 Answer, 1 is accepted

Sort by
1
Accepted
Nick Iliev
Telerik team
answered on 01 Jan 2024, 06:54 AM

Hello Herson,

 

In the provided snippet, you are using the AfterSessionComplete event which is when the response is already processed and is way too late to make any changes. To successfully modify a response use the BeforeResponse event.

More details on how to modify a response in FiddlerCore can be found in the following documentation article:

https://docs.telerik.com/fiddlercore/knowledge-base/modifying-response-with-fiddler-core 

 

Regards,
Nick Iliev
Progress Telerik

Love the Telerik and Kendo UI products and believe more people should try them? Invite a fellow developer to become a Progress customer and each of you can get a $50 Amazon gift voucher.

herson
Top achievements
Rank 2
Veteran
commented on 01 Jan 2024, 11:30 AM

Thank you very much.
Tags
Getting started with ASP.NET Miscellaneous
Asked by
herson
Top achievements
Rank 2
Veteran
Answers by
Nick Iliev
Telerik team
Share this question
or