Autoresponder and POST

4 posts, 0 answers
  1. Pär
    Pär avatar
    3 posts
    Member since:
    Mar 2014

    Posted 15 Aug 2014 Link to this post

    Is there a way to filter the requests on the content of the request body for Post? 
    I just want to autorespond to a certain body.

    BR Pär
  2. Graeme
    Graeme avatar
    31 posts
    Member since:
    Aug 2014

    Posted 15 Aug 2014 in reply to Pär Link to this post

    You can do that using fiddlerscript
  3. Graeme
    Graeme avatar
    31 posts
    Member since:
    Aug 2014

    Posted 15 Aug 2014 in reply to Graeme Link to this post

    Can't edit my last post. You probably want to use utilCreateResponseAndBypassServer()
  4. Eric Lawrence
    Admin
    Eric Lawrence avatar
    833 posts

    Posted 15 Aug 2014 Link to this post

    Hi, Par--

    Graeme is correct in noting that you can autorespond using FiddlerScript's utilCreateResponseAndBypassServer() method after matching on any criteria you like.

    However, you can also use the AutoResponder itself for this task. From the Fiddler Book:

    Matching Against Request Bodies

    In some cases, a site may use the same request URL for many unrelated operations, specifying the operation desired in the request’s body instead of the URL. You may extend your Match Condition to examine a POST or PUT request’s body by specifying the URLWithBody: prefix for your Match Condition. When this prefix is used, the portion of the string up to the first space character is used as the Match Condition for the request’s URL, while the remainder of the string is used as a Match Condition for the string-representation of the request’s body. For performance reasons, you should specify the URL portion of the Match Condition as narrowly as possible to minimize the number of request bodies that the AutoResponder needs to evaluate. If a request has no body, it will not match any URLWithBody rule.

    Your Match Condition may specify the EXACT:, NOT:, and REGEX: prefixes for both the URL and the body. For example:

        URLWithBody:upload.php TextToFindInBody

        URLWithBody:login.php EXACT:Action=Login

        URLWithBody:ping.php NOT:POST Data I Do Not Care About

        URLWithBody:EXACT:https://example.com/upload.php REGEX:^.+TextToFind.*$

        URLWithBody:REGEX:^.+/upload.php.*$ REGEX:^.+TailOfPOST$

    Keep in mind that most POSTs from Web Forms encode the body text, so you should ensure that your Match Condition accounts for such encoding. For instance, to match the following POST:

        POST http://www.enhanceie.com/sandbox/FileForm.asp HTTP/1.1
        Content-Type: application/x-www-form-urlencoded
        Content-Length: 54 

        2=This+is+some+text&fileentry2=&_charset_=windows-1252

    Your Match Condition should be:

        URLWithBody:/sandbox/FileForm.asp This+is+some+text

    Regards,
    Eric Lawrence
    Telerik
     

    Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

     
Back to Top