With Apache Http client 5.1.x, I want to set timeout on every HTTP request(Get, Post, ..), as I don’t want to wait for more than certain period for obvious reasons. But I’m confused mostly between ConnectionRequestTimeout and ConnectTimeout. I’ve gone through some threads(eg./questions/78040298/best-way-to-configure-timeouts-on-apache-httpclient-5) but not able to understand the exact difference between them and which one to use for my use.
RequestConfig requestConfig =
RequestConfig.custom()
.setConnectionRequestTimeout(10)
.setConnectTimeout(10)
.setSocketTimeout(10)
.build();