Responding to the same rule whit 2 different files

25 views
Skip to first unread message

Ali Aalaoui

unread,
Feb 9, 2012, 1:19:01 PM2/9/12
to httpf...@googlegroups.com
Hello,
i want to create a rule that respond first time with FILE1 and second time whit FILE2 then if i query again reply with FILE1 how can i do it ?

Klaus Johannes Rusch

unread,
Feb 10, 2012, 2:39:20 AM2/10/12
to httpfiddler@googlegroups.com >> Fiddler
You could include a Set-Cookie header with the response, and choose
which file to send based on the incoming Cookie.

--
Klaus Johannes Rusch
klaus...@atmedia.net
http://klausrusch.atmedia.net/

bl4ck

unread,
Feb 12, 2012, 11:26:48 AM2/12/12
to Fiddler
Can I create a rule based on query length header or content?

On Feb 10, 8:39 am, Klaus Johannes Rusch <KlausRu...@atmedia.net>
wrote:
> On 2012-02-09 19:19, Ali Aalaoui wrote:> Hello,
> > i want to create a rule that respond first time with FILE1 and second
> > time whit FILE2 then if i query again reply with FILE1 how can i do it ?
>
> You could include a Set-Cookie header with the response, and choose
> which file to send based on the incoming Cookie.
>
> --
> Klaus Johannes Rusch
> klausru...@atmedia.nethttp://klausrusch.atmedia.net/

Klaus Johannes Rusch

unread,
Feb 13, 2012, 4:42:07 PM2/13/12
to Fiddler
On 12.02.2012 17:26, bl4ck wrote:
> Can I create a rule based on query length header or content?
Yes, look at the examples at
http://fiddler2.com/Fiddler/Dev/ScriptSamples.asp

EricLaw

unread,
Feb 13, 2012, 4:44:10 PM2/13/12
to Fiddler
Of course, you can create a rule based on anything you want.
> > klausru...@atmedia.nethttp://klausrusch.atmedia.net/- Hide quoted text -
>
> - Show quoted text -

EricLaw

unread,
Feb 13, 2012, 4:44:15 PM2/13/12
to Fiddler
// In global scope, add this var:
var bFile1: boolean = true;

// Inside OnBeforeRequest add this:

if (oSession.fullUrl.Contains("whateverIAmLookingFor"))
{
if (!bFile1){
oSession["x-replywithfile"] = "C:\\temp\\file2.dat";
bFile1 = true;
}
else
{
oSession["x-replywithfile"] = "C:\\temp\\file1.dat";
bFile1 = false;

Ali Aalaoui

unread,
Feb 18, 2012, 8:13:58 PM2/18/12
to httpf...@googlegroups.com
Thank you EricLaw this helped me Alot !
Reply all
Reply to author
Forward
0 new messages