def upload_marcxml(self, marcxml, mode):
        """Upload a record to the server.

        :param marcxml: the XML to upload.
        :param mode: the mode to use for the upload.
            - "-i" insert new records
            - "-r" replace existing records
            - "-c" correct fields of records
            - "-a" append fields to records
            - "-ir" insert record or replace if it exists
        """
        if mode not in ["-i", "-r", "-c", "-a", "-ir"]:
            raise NameError("Incorrect mode " + str(mode))

        return requests.post(self.server_url + "/batchuploader/robotupload",
                             data={'file': marcxml, 'mode': mode},
                             headers={'User-Agent': CFG_USER_AGENT})
Upload a record to the server.

        :param marcxml: the XML to upload.
        :param mode: the mode to use for the upload.
            - "-i" insert new records
            - "-r" replace existing records
            - "-c" correct fields of records
            - "-a" append fields to records
            - "-ir" insert record or replace if it exists