Reputation: 191
Is it possible to do the same thing that Tamper Data does but within a C# program? Like if I give the program a session ID and I want that session ID inserted in every cookie sent into outgoing HTTP request to a certain site? I want to be able to stop outgoing HTTP requests and edit them as I like and then let them go.
Is it possible or do I need to create an extension for my browser?
Upvotes: 1
Views: 215
Reputation: 771
If you could use a third party program, I would suggest you to use Fiddler which is available for free.
To automate an action, you could create a .Net dll with your logic and then load it in Fiddler, or write a simple script in JScpript which will be probably easy if your logic is quite simple.
What you need is to add a rule as explained here in the manual.
If you decide to use JScript, you could find some examples in the manual.
To set the cookie you could do something similar to this in OnBeforeRequest:
oSession.oRequest["Cookie"] = (oSession.oRequest["Cookie"] + ";SessionID=YOUR_SESSION_ID");
Upvotes: 2