title: I have to pass one value in payload for REST API as dynamic value which need to be converted to Text to Gzip Compress using Python2.7
body: <p>In payload one value is as below to be converted this value to Gzip Compress in Python for REST API as we are using Python 2.7</p>
  <p>Original Value:-</p>
  <p>&lt;ATTACHMENT_ID&gt;ff38fac4-d962-49b1-843f-34d352b6ff49&lt;/ATTACHMENT_ID&gt;0cc5e563-42e5-4e37-81ce-f25cc8756346&lt;SF_OBJECT_ID&gt;7d80f6ad-803b-475c-86b7-f10e28986df7&lt;/SF_OBJECT_ID&gt;&lt;SF_OBJECT_TYPE&gt;Agreement&lt;/SF_OBJECT_TYPE&gt;&lt;SF_OBJECT_VERSION&gt;1.0&lt;/SF_OBJECT_VERSION&gt;&lt;SF_TEMPLATE_VERSION&gt;&lt;/SF_TEMPLATE_VERSION&gt;&lt;SF_BUSINESS_OBJECT_CONTEXT&gt;Agreement&lt;/SF_BUSINESS_OBJECT_CONTEXT&gt;FalseFalse</p>
  <p>To be converted to gzip compress</p>
  <p>H4sIAAAAAAAACn2Sb2+CMBDGP1HHvwIlaUgQ62SZaEZntlcG2qsjEUoAZ/btByZOdNne3T33e55ek6NR08+12LS6gbYvoQtpxHkUL1cs5btkHirlEJULjGTg2QgHhYUIdhRysHRcu/CUwgE1bj10SDxWUPdDbQrhgus5CNvgIgyOj4glACnbFYL4wwR71JgY6AraPSS10iHdQtuVug6pca0m42yxW8+eWHx+1JfEVF4uETGdAmHfFYh4hY+UZYJNAuJJ5VPjxjIJ4O8bFkb7FmBcY8qdJxNyy16yZJ2G1oM5xS7ySHK22jxHnF3FEfytDuLsNUtSlmWXmHidcvbG71b5i6IcquaQ9zB+xpg2y7zLqrztkx6qcJEfOqDGjUZf4LOE02Orj00iB/ddvywlZB/6dHbEuu6HXWb6WMu8/foJ/I8ZjuL+tL4Bxmc3aG0CAAA=</p>
  <p>I am able to do this using this link online - <a href="https://www.multiutil.com/text-to-gzip-compress/" rel="nofollow noreferrer">https://www.multiutil.com/text-to-gzip-compress/</a></p>
  <p>I explored many options in python2.7 but was not able to get the exact format after encoding as mentioned above. I need the exact string as above after encoding.</p>
  <p>I tried using the below code, but it is not giving me the required value after encoding</p>
  <p>code = base64.b64encode(zlib.compress(compress, 9))
  code = code.decode('utf-8')</p>