How to change aaa.com to bbb.com before request using fiddlercore?

73 views
Skip to first unread message

Charltsing Liu

unread,
Oct 6, 2016, 9:48:47 AM10/6/16
to Fiddler

        private void FiddlerApplication_BeforeRequest(Session oSession)
        {
            if (oSession.url.Contains("www.aaa.com"))
            {
                oSession.bBufferResponse = true;
                //oSession.utilSetRequestBody
                //oSession.utilReplaceInRequest                
            }
        }

How to change aaa.com  to  bbb.com  before request?

Charltsing Liu

unread,
Oct 6, 2016, 10:38:32 AM10/6/16
to Fiddler
i used   oSession.oRequest.headers.RequestPath = oSession.oRequest.headers.RequestPath.Replace("1111","2222");

it works well.

Eric Lawrence

unread,
Oct 6, 2016, 3:13:27 PM10/6/16
to Fiddler
This topic is well-covered in the Fiddler book, as there are three different ways to do this. 

Typically, you'd do something like:

   if (oSession.HostnameIs("www.aaa.com")) oSession.host = "www.bbb.com";


Reply all
Reply to author
Forward
0 new messages