FiddlerCore - BeforeRequest - Return file

1 Answer 56 Views
FiddlerCore Windows
Oskar
Top achievements
Rank 1
Oskar asked on 15 Aug 2023, 07:03 PM
Hi, how would I in the BeforeRequest event return a file from the local computer?

This is related to FiddlerCore, and I'm trying to recreate the function of the Fiddler AutoResponder, to match a string and then respond with a file. Would BeforeRequest be the right thing?

I found this somewhere else on the forum: http://fiddler.wikidot.com/fiddlercore-autorespond

Hope someone has a bit more knowledge,

Thanks

1 Answer, 1 is accepted

Sort by
0
Nick Iliev
Telerik team
answered on 16 Aug 2023, 06:32 AM

Hello Oskar,

 

In FiddlerScript, you can use the x-replywithfile flag to provide a locally loaded file (from folder \Captures\Responses).

// Respond to a request with a file loaded from the \Captures\Responses folder	

if (oSession.PathAndQuery=="/version1.css") {
  oSession["x-replywithfile"] ="version2.css";
}	

// use it with OnBeforeRequest or OnBeforeResponse

 

 

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.

Tags
FiddlerCore Windows
Asked by
Oskar
Top achievements
Rank 1
Answers by
Nick Iliev
Telerik team
Share this question
or