You need to sign in to do that
Don't have an account?
shiv kumar 48
Decompress json response using Apex
I am calling a rest api and it returns a response in compress format some like below , how to decompress this response in salesforce and read the data using apex
�\kw�6��+�~�9'��~x;����vb���l����%��D"�r���J��H��h�����x�P����0��4ɣ/����S�?/�NO���oa+|����,�=�_�y�l'Q~�_O�{�!�� �Y��>�v��s�DI�<���%�������ur�����6|G��Z[�<��G��g|sr\�� oY7Φ�8GV�z�2)�,�}�WeA��*\p�������q�/�4��H}���8 �h����nK�Z�>��3�=Ӎ��M/ZN��9��=6^t�d�#{?~8�?짋3����`�0�����Z������iڙ�s؏�'Q�R�|%~��x���x���]e�_�DY�� ��O�i� �=4f�-��-t�i0}�f�y4�|����oNn�՜�FA���ӈ��t���FGW�t���h�>�?��y���A�ʦ��!�/#�g�}�,�,�%M�B��;�mi�D��l���ۚ�k�U��V�����.6㤓�Y|�w��m_�4��Q��$�&v�Z�GKX��]'q�d�gƩ�����~��l(�ű��s��D3V�����$|�����Χ�9g&;�<�^�E�f�p����Z[[k�;����<�)�GԷ�������>}�n��mξQ8�5��x��#�����O�=��L�9��^x?��9�N��:����)��.��h�:Ϩ�h�\W�j!�D�b�ʒ�V��m�j�v�Im�E뇊B_Yvu��r� �� F�܂w�����(�w'z[�;aQ2�L=ݝ\O-������%�`O�U��e�������n�3��������u��sݎ�������s�cy����V�A�g�5���`�5�z��uj>0���v^��y�����:�>�����~�e�v��V��Y<�܉�j��,֗��c�k�k�����.f V�\F��!���ӯ+��H� �m��j���) �s���ʶJf__^��<�m���ؚ湮T\�)~��"J�*Em3������.��]�����`�����0ۡ�__p��`�m��훠�iK��Ɍ�g���J�r,�����)s�6ӱX�욆���{��zqİ�ӧmO�;%����CS�x<f�t&OCTX,�Ҋ��`CTO�A�2h�����O��|Z�Y�sL�t\ͷ=?�%�k�_�O{�.������7�ۭ�ǃ�;�ǃ�������B9�oX�c�VY9�n���8�ˬI��f[�-C�O2~Q��Z��!�4�Ru[��1q����դol5��Ф:7��Mì^��V��z#B��*H��zy�[Wj�|^��+�co���P��~a���MV ́u�� LU�OVA ��˓�*�R9���d]�����:'����yK�6mY�GԒZ��J�{LlY���?"*��V��b���m��},~�u�6�a�.�^�4� Se����BQ�
�\kw�6��+�~�9'��~x;����vb���l����%��D"�r���J��H��h�����x�P����0��4ɣ/����S�?/�NO���oa+|����,�=�_�y�l'Q~�_O�{�!�� �Y��>�v��s�DI�<���%�������ur�����6|G��Z[�<��G��g|sr\�� oY7Φ�8GV�z�2)�,�}�WeA��*\p�������q�/�4��H}���8 �h����nK�Z�>��3�=Ӎ��M/ZN��9��=6^t�d�#{?~8�?짋3����`�0�����Z������iڙ�s؏�'Q�R�|%~��x���x���]e�_�DY�� ��O�i� �=4f�-��-t�i0}�f�y4�|����oNn�՜�FA���ӈ��t���FGW�t���h�>�?��y���A�ʦ��!�/#�g�}�,�,�%M�B��;�mi�D��l���ۚ�k�U��V�����.6㤓�Y|�w��m_�4��Q��$�&v�Z�GKX��]'q�d�gƩ�����~��l(�ű��s��D3V�����$|�����Χ�9g&;�<�^�E�f�p����Z[[k�;����<�)�GԷ�������>}�n��mξQ8�5��x��#�����O�=��L�9��^x?��9�N��:����)��.��h�:Ϩ�h�\W�j!�D�b�ʒ�V��m�j�v�Im�E뇊B_Yvu��r� �� F�܂w�����(�w'z[�;aQ2�L=ݝ\O-������%�`O�U��e�������n�3��������u��sݎ�������s�cy����V�A�g�5���`�5�z��uj>0���v^��y�����:�>�����~�e�v��V��Y<�܉�j��,֗��c�k�k�����.f V�\F��!���ӯ+��H� �m��j���) �s���ʶJf__^��<�m���ؚ湮T\�)~��"J�*Em3������.��]�����`�����0ۡ�__p��`�m��훠�iK��Ɍ�g���J�r,�����)s�6ӱX�욆���{��zqİ�ӧmO�;%����CS�x<f�t&OCTX,�Ҋ��`CTO�A�2h�����O��|Z�Y�sL�t\ͷ=?�%�k�_�O{�.������7�ۭ�ǃ�;�ǃ�������B9�oX�c�VY9�n���8�ˬI��f[�-C�O2~Q��Z��!�4�Ru[��1q����դol5��Ф:7��Mì^��V��z#B��*H��zy�[Wj�|^��+�co���P��~a���MV ́u�� LU�OVA ��˓�*�R9���d]�����:'����yK�6mY�GԒZ��J�{LlY���?"*��V��b���m��},~�u�6�a�.�^�4� Se����BQ�
If it doesn't work, I recommend checking whether your post request is properly formed
1) Go to postbin.defensio.com/ and click Create a new PostBin
2) Use the URL obtained as the endpoint of the request.
3) Make a request and check the URL back.
https://help.salesforce.com/articleView?id=000321529&language=en_US&type=1&mode=1
Also, You have to ensure when a request is sent in compressed format, the following fields are present in the headers:
Content-Encoding: gzipAccept-Encoding: gzip
There have been relevant discussions in the past around this, for example, see this post
This is when salesforce post any request to external system using compressed format and that external system sends any response then response is decompressed using this setting.
But here we are not posting anything, its a GET request to external system not POST.