What is the default timeout for httpClient calls made through Javascript?

Not applicable

I want to know what is the defalut timeout value for httpClient calls made through Javascript .

0 3 1,746
3 REPLIES 3

I believe the default is something high like 60 seconds - however it is much more likely that the timeLimit set in the Javascript Callout policy will be reached sooner.

If you would like to set the timeout yourself, increase the timeLimit and provide a timeout in waitForComplete(timeout);

e.g.

<Javascript async="false" continueOnError="false" enabled="true" timeLimit="5500" name="MyJS">


and

var ex1 = httpClient.get("http://www.example.com?api1"); 
context.session["ex1"]= ex1;// Put the object into the session
ex1.waitForComplete(5000);  

See: http://docs.apigee.com/api-services/reference/javascript-object-model#makingjavascriptcalloutswithht...

I wanted to know , if we don'y specify waitForComplete method , then what is by default value of timeout to backend connectivity.

Can you please also clarify the timeout mentioned in xml , does that play any role in timeout ,

I know it is the overall execution timeout of the Javascript policy, but what will happen if the timeout of httpclient is more than the time set in timeLimit tag of xml policy.

It should be easy to test and find out for yourself.

Do a callout to http://httpbin.org/delay/30

This will take 30 seconds to respond. You can check in trace if you have got a response in this time. I'll also try this at some point