0

I'm monitoring network data for my mobile application and while capturing the data I got the response in following format

    "postData": {
            "mimeType": "application/json; charset=utf-8",
            "text": "\u001f�\b\u0000\u0000\u0000\u0000\u0000\u0000\u0000�V[S�8\
u0014�+����l�qx�\t-�l!M)-�^�#�'�6��Jr2)��#��\u0002<���`�M
��������<3����\u001e��l�bɌ�$+�\u0001�yP�\\@�xb�L�RI^�@iY3�
53\\�\u0018��)�j3�0[D\u0001+���/�����渒�+��������*�N\u0016J�\rz50U
    }

Headers Information:

"headers": [
        {
          "name": "Content-Encoding",
          "value": "gzip"
        },
        {
          "name": "Content-Type",
          "value": "application/json; charset=utf-8"
        },
        {
          "name": "Transfer-Encoding",
          "value": "chunked"
        },
        {
          "name": "Connection",
          "value": "Keep-Alive"
        },
        {
          "name": "Accept-Encoding",
          "value": "gzip"
        }
      ],

I'm not able to understand how to get the actual data out of it. Search internet didn't find any solution for this.

  • You can try with URLDecoder.decode .. – Amit May 19 '18 at 16:41
  • that looks fairly broken, it's maybe not actual text but binary data. Whatever you use to decode the json (jackson/gson/..) should be able to decode that too (and do so automatically) since `\u001f` is the json way of escaping unicode (https://en.wikipedia.org/wiki/JSON#Data_portability_issues). – zapl May 19 '18 at 16:53
  • @zapi Tried following but its giving same thing, not able to decode it. String st="\\u001f�\\b\\u0000\\u0000\\u0000\\u0000\\u0000\\u0000\\u0000�V�r�6\\u0010"; Gson gson=new Gson(); String info=gson.toJson(st); – Maninder Jeet Singh May 19 '18 at 19:38

1 Answers1

0

It might just be the compression used. Try taking "Accept-Encoding" out of the request header and it may then just return text because at the moment it could be using Gzip or something to compress the data

Damo
  • 361
  • 4
  • 16