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

Break new requests if response is false

11 Answers 280 Views
Fiddler Classic
This is a migrated thread and some comments may be shown as answers.
Adam
Top achievements
Rank 1
Iron
Adam asked on 14 Sep 2020, 05:24 AM
Hello Fiddler team,
Can you please tell me on how to achieve this. I am using classic fiddler.
I will send requests continuously. If response of the request is 'true', there is no need to worry. Till here no worries. But I want to break on new requests when response is false. How can this break be achieved?

11 Answers, 1 is accepted

Sort by
0
Nick Iliev
Telerik team
answered on 14 Sep 2020, 11:32 AM

Hello Adam,

 

You could use Auto Responder to create a rule that drops a connection based on specific content in the response. If the true/false value is received within the body content, you could use the UrlWithBody match rule. See more about that rule in this forum thread or the Fiddler book.

 

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/.

0
Adam
Top achievements
Rank 1
Iron
answered on 14 Sep 2020, 12:44 PM

Thank you for quick response, Nick :)

Yes. The true/false is received in response body.

The request url is something like this https://example.com/index

In auto responder I have set like this -

If request match

URLWithBody:EXACT:https://example.com/index REGEX:^.+False.*$

then respond with
*drop

I have also ticked "Enable rules" in Auto Responder.

I seem to have hit dead end. It is now breaking everything if I enable automatic breakpoint after response.

If I disable automatic breakpoints, the response is 404. I seem to be doing something wrong. Can you please guide me, I have no adequate knowledge on this.

 

Thank you.

0
Nick Iliev
Telerik team
answered on 15 Sep 2020, 10:22 AM

Hi Adam,

 

Indeed there seems to be an issue when using REGEX to specify the body content. The team is looking into the case and I will report back once we know more.

 

Meanwhile, you could create the rule without using gular expression but with directly providing the wanted content.

For example, let's assume that your endpoint is https://httpbin.org/anything and as a Body, you are passing

isReceived: true

Then your rule could look for the key or for the value (or for any keyword that needs to be present in the Body)

URLWithBody:https://httpbin.org/anything isReceived

 

 

 

Regards,
Nick Iliev
Progress Telerik

Five days of Blazor, Angular, React, and Xamarin experts live-coding on twitch.tv/CodeItLive , special prizes and more, for FREE?! Register now for DevReach 2.0(20).

0
Adam
Top achievements
Rank 1
Iron
answered on 12 Apr 2021, 06:08 PM

Hello Nick & Telerik team,

I was not keeping well and hence couldn't pursue this back then. Sorry for reopening this topic after this long. 

Let's take your example 

If endpoint is https://httpbin.org/anything and as a Body, I am passing
isReceived: true

And, supposing I am look for the keyword "example" in the response

then my rule should like 

URLWithBody:https://httpbin.org/anything example

So, If I am running this request sequentially, for 100 times and if the server responds with the key example at any point of the sequential response, further sequential requests should automatically break/drop. How can I achieve this?

 

 

 

Regards,

Adam

0
Nick Iliev
Telerik team
answered on 14 Apr 2021, 02:03 PM

Hey Adam,

 

I suppose you could use FiddlerScript and code your custom logic where, for example, in the onBeforeRequest method to check (and update) your own condition (received from the specific endpoint) and if needed, to drop all traffic or apply the custom action you want.

 

Regards,
Nick Iliev
Progress Telerik

Love the Telerik and Kendo UI products and believe more people should try them? Invite a fellow developer to become a Progress customer and each of you can get a $50 Amazon gift voucher.

0
Adam
Top achievements
Rank 1
Iron
answered on 14 Apr 2021, 07:20 PM

Hello Nick,

Thanks for the reply. I had a hunch that I needed to use fiddlerscript as autoresponder is for requests, but thanks for clarifying. I do not have much knowledge in coding, but came up with a custom code in onBeforeRequest, but it obviously is wrong.

Supposing the endpoint is https://httpbin.org/anything and I am passing

isReceived: true

     

0
Adam
Top achievements
Rank 1
Iron
answered on 14 Apr 2021, 07:26 PM
[quote]Adam said:

Hello Nick,

Thanks for the reply. I had a hunch that I needed to use fiddlerscript as autoresponder is for requests, but thanks for clarifying. I do not have much knowledge in coding, but came up with a custom code in onBeforeRequest, but it obviously is wrong.

Supposing the endpoint is https://httpbin.org/anything and I am passing

isReceived: true

     

[/quote]

Since this request is issued sequentially, I want fiddler to break on if the server previous response has either keywords true or false

public static ToolsAction("Crawl Sequential URLs")
function doCrawl(){
var oFindStrings = new Array( "true", "false"); {
        oSession["x-breakrequest"]="breaking for POST";
            }
}

 

The above custom code I came up with, is wrong. Nick, can you please guide me with the correct code to place in fiddlerscript.

 

Regards,

Adam

0
Adam
Top achievements
Rank 1
Iron
answered on 15 Apr 2021, 05:33 AM
I was able to custom code it. Thanks a lot Nick :)
0
Adam
Top achievements
Rank 1
Iron
answered on 15 Apr 2021, 04:41 PM

Hello Nick,

I have a last question. In the reissue sequentially, the default value is 5, see here - https://i.ibb.co/9YFFc38/fiddler.jpg . We can change it to the number of our choice. But is there any way to change the default value 5 to 100(as default)?

 

Regards,

Adam

0
Nick Iliev
Telerik team
answered on 16 Apr 2021, 08:43 AM

Hi Adam,

 

Currently, there is no option to change the default value of the repeat counter. It's hardcoded to 5, and there is no UI or non-UI option to apply a different value.

 

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/.

0
Adam
Top achievements
Rank 1
Iron
answered on 09 May 2021, 12:35 AM | edited on 09 May 2021, 03:15 AM
Thank you

 

 

 

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