Description
When using Ti.Network.createHTTPClient and setting the properties in the create method to false it is ignored and they default to true.
The workaround is to use one of the two ways below to set the properties to false.
client.setAutoRedirect(false);
client.setAutoEncodeUrl(false);
or
client.autoRedirect = false;
client.autoEncodeUrl = false;
Steps To Reproduce
1. Create a project and add the app.js attached
2. Build to an Android device/simulator and then tap the button
Actual Result
The properties set to true, the URL is auto-redirected and auto-encoded, in the Studio console you should see what is attached in consoleLog.txt
Expected Result
The properties should stay false and it should not auto-redirect or auto-encode the URL.
FYI.
Docs to not specify otherwise, so it's assumed you can do this in the constructor. Appears to work for iOS.
To allow this in Android when creating HTTPClient. PR: https://github.com/appcelerator/titanium_mobile/pull/6532
Expected behavior running this code with PR above: Status code 200 (OK) Otherwise we'd get status 302 (needs redirecting)
Not a regression, moving out of 3.5.0.
Useful link to test autoEncodeURL: var url = "http://chart.apis.google.com/chart?chco=666666,555555,444444,333333,222222&chs=288x150&cht=p&chd=t:36,15,12,10,26&chdl=xyz%7Cabc%7Cdef%7Cghi%7Cjkl&chdlp=b&chf=c,s,ffffff%7Cbg,s,ffffff&chl=36%|15%|12%|10%|26%";
Verified with below Test Environment: 1. Mac OSX Yosemite 10.10.1 2. Appcelerator Studio, build: 4.0.0.201502111458 3. Titanium SDK, build: 4.0.0.v20150211151855 4. Titanium CLI, build: 3.6.0-dev 5. Alloy: 1.5.1 6. Nexus 6 with Android 5.0 The properties autoRedirect and autoEncodeUrl are set as false. The URL is neither auto-redirected nor auto-encoded as seen in the studio console. Closing this ticket.