lib/mw/ApiRequest.js
function TemplateDataRequest(env, template, queueKey) {
	ApiRequest.call(this, env, null);
	this.env = env;
	this.text = template;
	this.queueKey = queueKey;
	this.reqType = "TemplateData Request";

	var apiargs = {
		format: 'json',
		// XXX: should use formatversion=2
		action: 'templatedata',
		includeMissingTitles: '1',
		titles: template,
	};

	this.requestOptions = {
		// Use GET so this request can be cached in Varnish
		method: 'GET',
		qs: apiargs,
		followRedirect: true,
		uri: env.conf.wiki.apiURI,
		timeout: env.conf.parsoid.timeouts.mwApi.templateData,
	};

	this.request(this.requestOptions);
}
function TemplateDataRequest(env, template, queueKey) {
	ApiRequest.call(this, env, null);
	this.env = env;
	this.text = template;
	this.queueKey = queueKey;
	this.reqType = "TemplateData Request";

	var apiargs = {
		format: 'json',
		// XXX: should use formatversion=2
		action: 'templatedata',
		includeMissingTitles: '1',
		titles: template,
	};

	this.requestOptions = {
		// Use GET so this request can be cached in Varnish
		method: 'GET',
		qs: apiargs,
		followRedirect: true,
		uri: env.conf.wiki.apiURI,
		timeout: env.conf.parsoid.timeouts.mwApi.templateData,
	};

	this.request(this.requestOptions);
}
function TemplateDataRequest ( env , template , queueKey ) { ApiRequest . call ( this , env , null ) ; this . env = env ; this . text = template ; this . queueKey = queueKey ; this . reqType = "TemplateData Request" ; var apiargs = { format : 'json' , // XXX: should use formatversion=2 action : 'templatedata' , includeMissingTitles : '1' , titles : template , } ; this . requestOptions = { // Use GET so this request can be cached in Varnish method : 'GET' , qs : apiargs , followRedirect : true , uri : env . conf . wiki . apiURI , timeout : env . conf . parsoid . timeouts . mwApi . templateData , } ; this . request ( this . requestOptions ) ; }
Fetch TemplateData info for a template.
This is used by the html -> wt serialization path.

@class
@extends ~ApiRequest
@param {MWParserEnvironment} env
@param {string} template
@param {string} [queueKey] The queue key.
Fetch TemplateData info for a template . This is used by the html - > wt serialization path .