[AC-2745] Ti.Include returns 500 because it uses "POST" not "GET"

GitHub Issuen/a
ResolutionWon't Fix
Resolution Date2011-10-13T12:44:01.000+0000
Affected Version/sn/a
Fix Version/sn/a
ComponentsTitanium SDK & CLI
LabelsHTML5, Mobile
ReporterChristopher Spence
AssigneePaul Dowsett


Perhaps this is an issue with the server side, but from my understanding you're supposed to be using "GET" and not "POST" when requesting a script file. Ti.include (Ti.js ln 43) calls _loadSyncScript, which does an XHR call using "POST", which causes the call to fail and the script not returned. The working code:
function _loadSyncScript(_location) {
	if ('undefined' != typeof _loadedScripts[_location]) {
		return _execScript(_loadedScripts[_location]);
	var _xhr = new XMLHttpRequest(); 
	_xhr.onreadystatechange = function() {
		if (_xhr.readyState == 4) {
			if (_xhr.status == 200) {
				_loadedScripts[_location] = _xhr.responseText;
	_xhr.setRequestHeader("Content-Type", "text/xml; charset=utf-8");


  1. Christopher Spence 2011-10-13 Also on a side note, I would imagine the content-type should be set to "application/javascript" when retrieving a script, but I left it as "text/xml" since the code is now working even with "text/xml" in place.
  2. Paul Dowsett 2011-10-13 I am sorry, Christopher, but we do not support software until its official release. That said, this part of the product is being rewritten, so it should be resolved by the next version. Thanks for your input.
  3. Paul Dowsett 2011-12-27 Ticket resolved and not updated since last curator action.

JSON Source