fiddler auto responder

1 Answer 263 Views
Fiddler Classic
ytry
Top achievements
Rank 1
ytry asked on 18 Nov 2022, 03:46 PM | edited on 18 Nov 2022, 03:47 PM

i want to make fiddler auto responder with c# or vb.net or python console 

i have c# application get authentication from this url https://pastebin.com/raw/gFUrjSW3 and i want to change the string in the url (123456) to a specific string (112233445566) and i create this c# script but nothing happened 

private bool Request_licensemanager_azurewebsites_net(out HttpWebResponse response)
{
response = null;

try
{
HttpWebRequest request = (HttpWebRequest)WebRequest.Create("https://pastebin.com/raw/gFUrjSW3");

request.Headers.Add("token", @"eyJhbGciOiJodHRwOi8vd3d3LnczLm9yZy8yMDAxLzA0L3htbGRzaWctbW9yZSNobWFjLXNoYTI1NiIsInR5cCI6IkpXVCJ9.eyJleHAiOjE5Mjc4Mzk1MTksImlzcyI6IjQxMmZlNmNkLTBkZDktNDhmMi05Zjk3LTkxMzVkNTllMzA4ZSJ9.UJcK78RYkAJXZcqOJ4AnBS7Uoz7Uh8G2yF_aei48wWM");
request.ContentType = "application/json; charset=utf-8";

request.Method = "POST";
request.ServicePoint.Expect100Continue = false;

string body = @"{"112233445566"}";
byte[] postBytes = System.Text.Encoding.UTF8.GetBytes(body);
request.ContentLength = postBytes.Length;
Stream stream = request.GetRequestStream();
stream.Write(postBytes, 0, postBytes.Length);
stream.Close();

response = (HttpWebResponse)request.GetResponse();
}
catch (WebException e)
{
if (e.Status == WebExceptionStatus.ProtocolError) response = (HttpWebResponse)e.Response;
else return false;
}
catch (Exception)
{
if(response != null) response.Close();
return false;
}

return true;
}

 

1 Answer, 1 is accepted

Sort by
0
Nick Iliev
Telerik team
answered on 21 Nov 2022, 07:25 AM

Hi Ytry,

 

The sample code is not related to the built-in AutoResponder of Fiddler Classic, which you can use to create a simple rule that modifies your response body (the streaming option must be OFF). If you are looking for a way to modify a response body with FiddlerScript, then refer to this documentation article.

Regards,
Nick Iliev
Progress Telerik

Virtual Classroom, the free self-paced technical training that gets you up to speed with Telerik and Kendo UI products quickly just got a fresh new look + new and improved content including a brand new Blazor course! Check it out at https://learn.telerik.com/.

Tags
Fiddler Classic
Asked by
ytry
Top achievements
Rank 1
Answers by
Nick Iliev
Telerik team
Share this question
or