This is a migrated thread and some comments may be shown as answers.

Modifying Sessions before the hit the server. [FiddlerScript]

6 Answers 142 Views
Fiddler Classic
This is a migrated thread and some comments may be shown as answers.
jacob
Top achievements
Rank 1
jacob asked on 16 Feb 2014, 03:43 AM
The title probably isnt the best way to describe what I need.

I tried using AutoResponder with no luck.
So I need to write a Fiddler Script.

There is a site making a request to a desktop application. (Through a Chrome Plugin.)
Then data is sent to the application which then modifies settings/options (Somewhat) based on that.
The reason AutoResponder wont work as well is because the request has data that is different each time.
So I was thinking about using FiddlerScript to 'match' a certain part of the request that doesnt change and then 'Auto Respond' with a file, instead of the original one.

Can anyone help me on how I would do this in FiddlerScript?

Sorry if its hard to understand, I barely understand all this fiddler stuff with the scripts and such.

But still, if anyone could help I would be SOOO grateful!

6 Answers, 1 is accepted

Sort by
0
jacob
Top achievements
Rank 1
answered on 16 Feb 2014, 04:04 AM
I should also mention that I need the data being sent in the url from the first one (everything thats after: .ashx) and I need it to be appended to the new url
So the real request or whatever would be http://host.com/Dir1/start.ashx?blah=blah&blah=blah&blah=6b7El46
and my site that is hosting the new start.ashx is : http://MYSITE.com/myDir1/start.ashx
But since I need the post data to be appended in the request or whatever, the new url would now be: 
http://MYSITE.com/myDir1/start.ashx?blah=blah&blah=blah&blah=6b7El46

Again thanks :)

(Sorry for my bad english still learning)
0
jacob
Top achievements
Rank 1
answered on 16 Feb 2014, 04:05 AM
I should also mention that I need the data being sent in the url from the first one (everything thats after: .ashx) and I need it to be appended to the new url
So the real request or whatever would be http://host.com/Dir1/start.ashx?blah=blah&blah=blah&blah=6b7El46
and my site that is hosting the new start.ashx is : http://MYSITE.com/myDir1/start.ashx
But since I need the post data to be appended in the request or whatever, the new url would now be: 
http://MYSITE.com/myDir1/start.ashx?blah=blah&blah=blah&blah=6b7El46

Again thanks :)

(Sorry for my bad english still learning)
0
EricLaw
Top achievements
Rank 1
answered on 16 Feb 2014, 11:33 AM
You can almost certainly do what you're asking using a Regular Expression in the AutoResponder.

See the end of this post for details: http://blogs.msdn.com/b/fiddler/archive/2012/01/09/fiddler-2.3.8.2-beta-views-woff-mp3-h264-datauris-and-autoresponder-supports-regular-expression-groups.aspx

(And yes, FiddlerScript can do this too)
0
jacob
Top achievements
Rank 1
answered on 16 Feb 2014, 09:02 PM
Thank you so much :D!

So to be clear how do I save the end of the url and move to the second one?
I read the post but the thing is in the first url there is also a bool value at the end and I need t change this to true, since it is false.

I think I understand but Im just not 100%, I dont really understand Regex :/

So sorry to bother.
0
jacob
Top achievements
Rank 1
answered on 16 Feb 2014, 09:06 PM
Man there needs to be an edit feature >_>

Anyways I solved it with your post I wasnt thinking when I went thru it, now it makes sense!

(Still not sure how to replace the bool at end with true :/ but other than that I think I got it!)
0
EricLaw
Top achievements
Rank 1
answered on 17 Feb 2014, 10:47 PM
I can help you write the regular expression you need; show me the old URL and what you want the new URL to be, as well as what regular expression you're using so far. Thanks!
Tags
Fiddler Classic
Asked by
jacob
Top achievements
Rank 1
Answers by
jacob
Top achievements
Rank 1
EricLaw
Top achievements
Rank 1
Share this question
or