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);
}