Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
fiddler url repeater
/*
https://example.com/?id={@start_decimal@,@limit_decimal@}
https://example.com/?id={@0@,@999@}
*/
static function OnBeforeRequest(oSession: Session) {
var regex = /{@([0-9]+)@,@([0-9]+)@}/i;
var repeater = oSession.PathAndQuery.match(regex);
if (repeater) {
var path = oSession.PathAndQuery;
var headers = oSession.oRequest.headers;
headers = headers.ToString();
headers = headers.Substring(headers.IndexOf(Environment.NewLine) + 1);
var body = oSession.GetRequestBodyAsString();
var start = Int32.Parse(repeater[1]);
var limit = Int32.Parse(repeater[2]);
for (var x = start; x < start+limit; x++){
oSession.PathAndQuery = path.replace(regex, x);
if (x < start+limit-1) {
FiddlerObject.utilIssueRequest("GET " + oSession.fullUrl + " HTTP/1.1" +
Environment.NewLine + headers.ToString().Trim() +
Environment.NewLine + Environment.NewLine + body.Trim());
}
System.Threading.Thread.Sleep(2000);
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment