Converts payload to a string. Complex objects are dumped to json

def _convert(self, payload):
        """
        Converts payload to a string. Complex objects are dumped to json
        """
        if not isinstance(payload, six.string_types):
            payload = json.dumps(payload, cls=DefaultJSONEncoder, sort_keys=True)
        return str(payload)