I want to edit a URL using fiddler. Doesn't have to be with fiddler script, but heres an approximation of how I'm doing it currently:
if (oSession.url.contains("example.com") {
String oldUrl = oSession.url.ToString();
Regex rgx = new Regex("1.2");
String newUrl = rgx.Replace(oldUrl, "1.0");
}
This code is giving me a compiler error on the regex instantiation line: "The list of attributes does not apply to the current context". I'm not entirely sure what this means.
I'm also unsure how exactly to change the url.
Any ideas?
Fiddler's default rules are stored in \Program Files\Fiddler2\Scripts\SampleRules. js. You can change the JScript editor launched from the Rules menu. Click Tools | Fiddler Options and edit the Editor string.
Just got it:
oSession.url = oSession.url.Replace("1.2","1.0");
You can also use
oSession.PathAndQuery = oSession.PathAndQuery.replace('/test1/', '/changed1/');
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With