def as_curl(self, endpoint, encoded_data, headers):
header_list = [<EOL>'<STR_LIT>'.format(<EOL>key.lower(), val) for key, val in headers.items()<EOL>]<EOL>data = "<STR_LIT>"<EOL>if encoded_data:<EOL><INDENT>with open("<STR_LIT>", "<STR_LIT:wb>") as f:<EOL><INDENT>f.write(encoded_data)<EOL><DEDENT>data = "<STR_LIT>"<EOL><DEDENT>if '<STR_LIT>' not in headers:<EOL><INDENT>header_list.append(<EOL>'<STR_LIT>'.format(len(encoded_data)))<EOL><DEDENT>return ("""<STR_LIT>""".format(<EOL>url=endpoint, headers="<STR_LIT>".join(header_list), data=data))<EOL>
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