0

Using Fiddler.

Im listening only traffic from eg

superhost.org

which is added to my filters (eg via "Show only if URL contains").

Traffic consists of similar POST requests, which could be different only by Body. Example:

First request:

{
  "param 1" : "1"
  "param 2" : "2"
}

Second request:

{
  "param 1" : "1"
  "param 2" : "3"
}

All headers etc same, only body differs.

Question: How i can listen(simply saying - see in Requests list in Fiddler) for only requests, which has "param 2" : "3" in body. (So, in our fakeExample, Request1 should be filtered out, and only Request2 should be listened by Fiddler)

2
  • By "listened" you mean displayed in the request/response list?
    – Robert
    Nov 5, 2020 at 14:26
  • @Robert : in Requests list, which we see in Fiddler in left part.
    – Dmitry
    Nov 5, 2020 at 16:09

1 Answer 1

2

You can do that using Fiddler.Script, that reads the body, checks if it contains the string and if it finds the string hides the complete request/response:

static function OnBeforeRequest(oSession: Session) {
    
    if (oSession.HostnameIs("superhost.org")) {
        var body = oSession.GetRequestBodyAsString();
        if (!body.Contains("\"param 2\" : \"3\"")) {
            oSession["ui-hide"] = "does not have search string";
        }
    }
}

For an more advanced version you could check the path and/or content-type of the request before and then parse it to JSON so that formatting changes do not affect the recognition of the value you are searching.

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.