docs: def as_curl(self, endpoint, encoded_data, headers):
          """Return the send as a curl command.
  
          Useful for debugging. This will write out the encoded data to a local
          file named `encrypted.data`
  
          :param endpoint: Push service endpoint URL
          :type endpoint: basestring
          :param encoded_data: byte array of encoded data
          :type encoded_data: bytearray
          :param headers: Additional headers for the send
          :type headers: dict
          :returns string
  
          """
          header_list = [
              '-H "{}: {}" \\ \n'.format(
                  key.lower(), val) for key, val in headers.items()
          ]
          data = ""
          if encoded_data:
              with open("encrypted.data", "wb") as f:
                  f.write(encoded_data)
              data = "--data-binary @encrypted.data"
          if 'content-length' not in headers:
              header_list.append(
                  '-H "content-length: {}" \\ \n'.format(len(encoded_data)))
          return ("""curl -vX POST {url} \\\n{headers}{data}""".format(
              url=endpoint, headers="".join(header_list), data=data))