Ionic Native HTTP Plugin - setRequestTimeout issue

Hi there,

in my case it seems that my requests not affected by the method. Can anyone confirm this? I set it to 5 seconds but it will appear in the default 60.

Thank you

                this.nativeHttp.setDataSerializer("json");
                this.nativeHttp.setRequestTimeout(5);
                this.nativeHttp.post(request.url, request.data, { "Content-Type": request.contentType}).then(data => {
                    let result : HttpResponse = new HttpResponse();
                    result.statusCode = data.status;
                    result.data = data.data;
                }, error => {
                    let result : HttpResponse = new HttpResponse();
                    result.statusCode = error.status;
                    result.data = error.data;
                });
1 Like

It seems that my firewall is the problem:

If i called a webservice where the request thread is sleeping 20sec - it works. The native http plugin cancelled the request after 5 seconds.

If i called that webservice and block it by my firewall (sophos utm / transparent proxy) it will not reject after timeout as expected. While C or .NET socket call timeout works as expected.

So it seems that the native plugin doesnt ignore anything like “tcp keep alive” - which means that there is no timeout if any bytes flow…?

Thank you