Issue Description
Running the sample code below, we're trying to set a very high timeout for our HttpClient request. (It's a necessary change for our test environment.) Unfortunately, our increase seems to be ignored, and the connection always times out after 120 seconds.
Runnable Test Case
The variable ‘someurl’ can be replaced with the url of a slow responding API (an API which takes longer to respond).
var makeRestAPICall = function() {
// create the titanium HTTPClient
var httpClient = Titanium.Network.createHTTPClient();
//var someurl = "http://jsonplaceholder.typicode.com/posts/";
var someurl = "http://fake-response.appspot.com/?sleep=3000"
httpClient.setTimeout(300000);
/**
* httpClient error handler
* @method onerror
* @param {} e
* @return
*/
httpClient.onerror = function(e) {
Ti.API.info("API ERROR ", e.error);
};
/**
* httpClient Success Handler if and when response comes back the success function is called
* @method onload
* @return
*/
httpClient.onload = function(e) {
Ti.API.info("On load " + e);
};
// open the connection and set the appropriate request headers
httpClient.open("POST", someurl, true);
httpClient.setRequestHeader("Content-Type", "application/json; charset=utf-8");
// send the request
httpClient.send("");
};
makeRestAPICall();
the setTimeout doesn't seem to work for me either.