lib/mw/ApiRequest.js
function BatchRequest(env, batchParams, key) {
	ApiRequest.call(this, env);
	this.queueKey = key;
	this.batchParams = batchParams;
	this.reqType = 'Batch request';

	this.batchText = JSON.stringify(batchParams);
	var apiargs = {
		format: 'json',
		formatversion: 2,
		action: 'parsoid-batch',
		batch: this.batchText,
	};

	this.requestOptions = {
		method: 'POST',
		followRedirect: true,
		uri: env.conf.wiki.apiURI,
		timeout: env.conf.parsoid.timeouts.mwApi.batch,
	};

	// Use multipart form encoding to get more efficient transfer if the gain
	// will be larger than the typical overhead.
	if (encodeURIComponent(apiargs.batch).length - apiargs.batch.length > 600) {
		this.requestOptions.formData = apiargs;
	} else {
		this.requestOptions.form = apiargs;
	}

	this.request(this.requestOptions);
}
function BatchRequest(env, batchParams, key) {
	ApiRequest.call(this, env);
	this.queueKey = key;
	this.batchParams = batchParams;
	this.reqType = 'Batch request';

	this.batchText = JSON.stringify(batchParams);
	var apiargs = {
		format: 'json',
		formatversion: 2,
		action: 'parsoid-batch',
		batch: this.batchText,
	};

	this.requestOptions = {
		method: 'POST',
		followRedirect: true,
		uri: env.conf.wiki.apiURI,
		timeout: env.conf.parsoid.timeouts.mwApi.batch,
	};

	// Use multipart form encoding to get more efficient transfer if the gain
	// will be larger than the typical overhead.
	if (encodeURIComponent(apiargs.batch).length - apiargs.batch.length > 600) {
		this.requestOptions.formData = apiargs;
	} else {
		this.requestOptions.form = apiargs;
	}

	this.request(this.requestOptions);
}
function BatchRequest ( env , batchParams , key ) { ApiRequest . call ( this , env ) ; this . queueKey = key ; this . batchParams = batchParams ; this . reqType = 'Batch request' ; this . batchText = JSON . stringify ( batchParams ) ; var apiargs = { format : 'json' , formatversion : 2 , action : 'parsoid-batch' , batch : this . batchText , } ; this . requestOptions = { method : 'POST' , followRedirect : true , uri : env . conf . wiki . apiURI , timeout : env . conf . parsoid . timeouts . mwApi . batch , } ; // Use multipart form encoding to get more efficient transfer if the gain // will be larger than the typical overhead. if ( encodeURIComponent ( apiargs . batch ) . length - apiargs . batch . length > 600 ) { this . requestOptions . formData = apiargs ; } else { this . requestOptions . form = apiargs ; } this . request ( this . requestOptions ) ; }
Do a mixed-action batch request using the ParsoidBatchAPI extension.

@class
@extends ~ApiRequest
@param {MWParserEnvironment} env
@param {Array} batchParams An array of objects.
@param {string} key The queue key.
Do a mixed - action batch request using the ParsoidBatchAPI extension .