Re: Reissue a request every x minutes

2,742 views
Skip to first unread message

EricLaw

unread,
Jan 22, 2013, 11:21:52 AM1/22/13
to httpf...@googlegroups.com
The FiddlerScript engine would allow you to easily repeat a request on a timer. For instance, if you add the following functions just inside the Handlers block:
 


public static ToolsAction("Request by Timer")
function doIt()
{
var oTimer: System.Windows.Forms.Timer = new Timer();
oTimer.add_Tick(OnTimer);
oTimer.Interval = 3000;
oTimer.Start();
}

public static function OnTimer(sender: Object, ea: EventArgs)
{
var s = "GET /gallery/image1.htm HTTP/1.1\r\nHost: www.example.com\r\nX-My-Num: 1\r\n\r\n";
try{
FiddlerObject.utilIssueRequest(s);
}
catch(e){
MessageBox.Show("send failed" + e.ToString());
}
}

 
...The request will be sent every three seconds when the user chooses the Request by Timer command on the Tools menu. You could, of course, change this script to issue a request of your choosing (e.g. one that the user selected in the Web Sessions list).

On Tuesday, January 22, 2013 7:32:04 AM UTC-6, Shi Zuka wrote:
Is there any way to reissue a particular request every X minutes? (or seconds, obviously)

Thanks in advance.

H0lmesSherl0ck

unread,
Apr 11, 2014, 9:16:09 AM4/11/14
to httpf...@googlegroups.com
this worked but anyone knows why I put the timer as 3600000 (1hour) but the script runs every half an hour?

EricLaw

unread,
Apr 11, 2014, 12:18:43 PM4/11/14
to httpf...@googlegroups.com
You should add a call to FiddlerApplication.Log.LogString("!Running request") and then copy paste the contents of the Log tab, including the timers, to see what the exact time the request was executed is.

If I had to guess, I'd guess that you updated your FiddlerScript at some point about 30 minutes after you started it, and you didn't first stop the timer. As a consequence, you have two copies of the script running at the same time (30 minutes apart) and thus you're getting requests twice as often as you expect.

H0lmesSherl0ck

unread,
Apr 11, 2014, 12:57:54 PM4/11/14
to httpf...@googlegroups.com
i turned off capture so that only this script is running, exit and then request timer, so only 1 instance is looping
and i add a timer column so i can see the exact time "clientconnected"

H0lmesSherl0ck

unread,
Apr 11, 2014, 2:19:26 PM4/11/14
to httpf...@googlegroups.com
sry, turned out i forgot to save the rules! working correctly now, thanks all, great work!
fiddler is awesome

David Bouteiller

unread,
Dec 23, 2014, 7:32:19 AM12/23/14
to httpf...@googlegroups.com
Hey,
I'm pretty bad at this so how could you add a selected issue in the web session list ?

I would like to reissue every X seconds the issue selected like the replay button does.

Thanks

Annick Audet

unread,
Mar 19, 2018, 1:20:45 AM3/19/18
to Fiddler
Hi, any ways to do  this function but with multiple requests?

I try to add variables but it does not work.

thanks. 

Eric Lawrence

unread,
Mar 20, 2018, 3:59:30 PM3/20/18
to Fiddler
How did you attempt to "add variables" and what happened?
Reply all
Reply to author
Forward
0 new messages