def create_record(self, name, zone, type, data, extra=None):
        action = '/app/dns/dyndns.jsp?'
        if name:
            record_name = name + '.' + zone.domain
        else:
            record_name = zone.domain
        params = {'action': 'SET', 'name': record_name, 'value': data,
                  'type': type}

        if type == 'MX' and extra is not None:
            params['prio'] = extra.get('prio')
        try:
            response = self.connection.request(action=action, params=params)
        except ZonomiException:
            e = sys.exc_info()[1]
            if ('ERROR: No zone found for %s' % record_name) in e.message:
                raise ZoneDoesNotExistError(zone_id=zone.id, driver=self,
                                            value=e.message)
            raise e

        # we determine if an A or MX record already exists
        # by looking at the response.If the key 'skipped' is present in the
        # response, it means record already exists. If this is True,
        # then raise RecordAlreadyExistsError
        if len(response.objects) != 0 and \
           response.objects[0].get('skipped') == 'unchanged':
            raise RecordAlreadyExistsError(record_id=name, driver=self,
                                           value='')

        if 'DELETED' in response.objects:
            for el in response.objects[:2]:
                if el.get('content') == data:
                    response.objects = [el]
        records = self._to_records(response.objects, zone=zone)
        return records[0]
L{ChunkedEncoder} instances provide L{IConsumer}.
dataset/ETHPy150Open apache/libcloud/libcloud/dns/drivers/zonomi.py/ZonomiDNSDriver.create_record--crossover with--dataset/ETHPy150Open kuri65536/python-for-android/python-modules/twisted/twisted/web/test/test_newclient.py/RequestBodyConsumerTests.test_interface