Weird characters in body after request response
<p>I am  using NodeJS and Request to post JSON and get a result with data in it.</p>

<p>I set this request up with Postman and I get the JSON data back which is completely readable.</p>

<pre><code>{
  "d": {
    "__type": "Qvision.WoningenModule.Lib.aanbodcollection",
    "testOutput": "",
    "filter": null,
     ...
     etc.
  }
}
</code></pre>

<p>I generated the code snippet from Postman so I could put it on my NodeJS server with Request required. </p>

<p>When I try to run the request on my node server a encoded body.</p>

<pre><code>      ��`I�%&amp;/m�{J�J��t�`$ؐ@�������iG#)�*��eVe]f@�흼��{����{����;�N'���?\fdl��J�ɞ!���?~|?"~�G�����~�߿�^�=��'.������V�by�/��f�2?/&amp;�,[N�ٴ*�|�R��F�y�~�nW��^��ϋ����-�eI�Vm���Z�������|�ѣ��"���b�}�h�|+4���~QWU����&gt;������Ge6�ˆ�_��"����^o��bF�HO&lt;��GM[gYK���E�\/���G[��UN^��eN��͊�Ң��A_?�n���Ƙ˼Z�������f@��z�Qb=)��Zѯ��|�Fo+z�.~m.�z��墚�%��̫�uMs�y1�x�uA����&gt;���Ų��/�fZ��h����"����Y����͐Ƣ@w���w����5+s;�����1��2�$��G��?������Ų�b�O�ˬ����9���~P-gy�L��|i/�����Q��$_��H�E��_�|Y���� &lt;s8��/��8�����$��?~��C�J#{�3������o6ķ{�wSU4����YK���j�L�D�K�D��K�kan '$����uQ��ĺ�]�� ��J4Z������O������O?������O~�'��~��d?�N�{���G��{;����ݽ����*��}j���O�@�N�^=�ڊ&gt;+�Dƍ�]%QM�wjy���������!�)� ��������g���?�&amp;����R����i�|�6��N�U�v��o�&gt; ���;����`��?xpp��"f��������;�v��U�sДy~V�����w�o�m~�:#�������x�Ӄ��ß������`g��A�$�����&gt;�G�z����b���ߧ$�;�;�_�Mȼ�lv�`��po�vxNB{Y�WP?�����{{�j��t���g�˽����C�&gt;1j��G         jE���?���Ux�/ww���b2�DI���ݧ��aK� k5���}n]���|�tgw��:�;;���J���S�O��&gt;�O��/���\x�=��?��/�&gt;B����O���;��:ݻ�G��9�%�v&lt;�h䱶^:��{|�KF����{�����o�4����.�M�&lt;�=��w�����I����+M��&gt;i�{�ݽ��=�|oߨb3ޟ�.����v�����j��n�z|x��*1u?�~JF����à������c&amp;}mФK�س���f���t���&amp;ELF���e��&gt;�Y��?�.fUճ�;��oh����oЪ�?��#��si�)Z����9������~��/&gt;������Ҍ��}���KR�Cf����=��� 6�$3������Y5�~����vw�Hż�lvHf|�������Rh�s�T��gǌ����ݿo{�Y1�ԉ�o���{�`g_�kv̸��&gt;y��&gt;4���ϒ�;}@����l�Ϛ���O*l�S#�1ey����uЌ�����'�ۆ��o�ʤu�"җ��O~�,�{�����[Xo1��FQ����t���F�sk���h�|��d�������=��٦���&gt;�)F��=ܷif3���.)�J)_�~VͶ��&gt;E��ΰ�9�Y�����`��N��f��￻{� �ώ��z�Oi����턺���O?}`����1�~���;v6a=�̶�)-���6��7g�7tI���}�T���Mf������*ofy��ZbY��.�B��M���g�l� 3�?ͷ;�"���n�@_|sv{��� ���ݦo����ߟ�@�m\"�w����o?=��,��s;�v��7��Y�r�!%���c��Y���[R7����h�ڭX���)�}������ޣ���~�p�ٱ�~�(ͱc��d�g��������[1��ٱ�~�H�K��h��NHT��u��5��w������e���ɢ�LZt�)=s~��C^�v������Ɓ!K� �����F�x�c՟W-�I���U4�5Ɠl88�ױ�;����ￏx������5I�R84%�J�s��|�&lt;���ʚS��ӇdQ��O����W���g�GR{�~�=���r�ׇ�0����UL��bv��������&amp;��&gt;%"�^v��)��},�h�?+v��n����33����q�?Z8~H|���gɊ{}�k���C#�?kF������c�����^6�W��9,2�]������0�5���X.�D�0��&amp;;�SD(�������ڈ��� 5F�����1�?��&lt;�j��#���Ů�QψS�m����|�%������/�_�&lt;~�����9�e^^��nה���
�ϕ)���ރO�?��G�~�v�v�/3���i���������g�WZP}p���p��g�?ʑ����DT����l�#���{fWz��1�^�~�{��X����r��]
�vMw�ώ)�����?�p`2 0�?K�������m�?k��둖�|�gz�i���σ�| ���J����/YF��R�G?k��}b���#$߿1C~g��C�C������/� ��%K�9
</code></pre>

<p>Like this.
In Postman the data is fine but in Node it isn't. How can this be?
There is nothing wrong with my request as far as I know:</p>

<pre><code>var request = require("request");

var options = { method: 'POST',
  url: '****',
  headers: 
   { 'postman-token': '****',
     cookie: '****',
     'accept-language': 'nl-NL,nl;q=0.8,en-US;q=0.6,en;q=0.4',
     'accept-encoding': 'gzip, deflate, br',
     referer: '****',
     'content-type': 'application/json; charset=UTF-8',
     'user-agent': 'Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/51.0.2704.103 Safari/537.36',
     'x-requested-with': 'XMLHttpRequest',
     origin: '****',
     accept: 'application/json, text/javascript, */*; q=0.01',
     'cache-control': 'no-cache',
     pragma: 'no-cache',
     'content-length': '1035',
     connection: 'keep-alive',
     host: '****' },
  body: '{"****************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************}',
  //encoding: null
   };

request(options, function (error, response, body) {
  if (error) throw new Error(error);
  console.log(body);
});
</code></pre>

<p>The console.log gives the data shown in the 2nd code snippet.</p>

<p>Can someone explain to me what's going on and why this works in postman but not in Node?</p>