Help to decompress POST request

4 posts, 0 answers
  1. Command
    Command avatar
    2 posts
    Member since:
    Aug 2014

    Posted 04 Aug 2014 Link to this post

    Hello,

    Is there any way to decompress post data in Fiddler, sent from application? Post request to server contain headers like this:
    Content-type: application/x-compressed-json
    Content-length: 3xx

    Sent JSON data is unreadable. Any ideas are welcome! 
  2. Eric Lawrence
    Admin
    Eric Lawrence avatar
    833 posts

    Posted 04 Aug 2014 Link to this post

    Hello, "Command"--

    Fiddler can perform any transformation you like, but in order to do this, you would have to know what exactly "x-compressed-json" is-- this is not a standard data format.

    If you share a SAZ file (click Help > Send Feedback in Fiddler) containing such traffic, I can probably help.

    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.

     
  3. Command
    Command avatar
    2 posts
    Member since:
    Aug 2014

    Posted 06 Aug 2014 in reply to Eric Lawrence Link to this post

    Eric Lawrence said:
    ...but in order to do this, you would have to know what exactly "x-compressed-json" is-- this is not a standard data format.


    Tnx for the reply

    This is actually GZIP encoded data stream. If I save POST data only in file and then use GZIP decompressor, I can see all data in readable JSON format. But this is not a solution, because program send this every 150 seconds
  4. Eric Lawrence
    Admin
    Eric Lawrence avatar
    833 posts

    Posted 06 Aug 2014 Link to this post

    Click Rules > Customize Rules.

    Just inside the Handlers class, add the following:

    public static ToolsAction("decompressJSON")
    function dodecomp(oS: Session[])
    {
       for (var i: int=0; i<oS.Length; i++)
       {
         if (oS[i].oRequest.headers.ExistsAndContains("Content-Type", "application/x-compressed-json"))
         {
           oS[i].utilSetRequestBody(Utilities.GzipExpand(oS[i].requestBodyBytes));
           oS[i].oRequest["Content-Type"] = "application/json";
         }
       }
    }

    Save the file. You can now right-click sessions in the Web Sessions list and choose decompressJSON.

    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