I have the following snippet in my code which set a timeout in milliseconds for the request.But its not cancelled even if the timeout is met.
var httpURL = {
method : URLobj.method,
url : urlString,
data : data,
withCredentials : true,
headers : URLobj.headers,
timeout:200
};
this.$http(httpURL).success(successFunc).error(errorFunc);
Can someone please shed some light on how this timeout parameter can be used.I am using v1.2.26.

This would be how you create a $http call with a timeout
$http({
method: URLobj.method,
url: urlstring,
withCredentials : true,
headers: URLobj.headers,
timeout: 200
}).success(function(data){
// With the data succesfully returned, call our callback
successFunc(data);
}).error(function(){
errorFunc("error");
});
}
});
I had config.timeout = deferred.promise; in one of my interceptor which had overridden the value that i have set. Commenting it out worked for me.
config.timeout = deferred.promise;
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With