if (readTimeout != -1)
request.setReadTimeout(readTimeout);
if (connectionTimeout != -1)
request.setConnectTimeout(connectionTimeout);
HttpHeaders headers = new HttpHeaders();
headers.set("X-Factual-Lib", DRIVER_HEADER_TAG);
headers.set("Host", host);
if (headerProvider != null) {
Map<String, Object> info = headerProvider.getHeaders();
for (String key : info.keySet()) {
headers.set(key, info.get(key));
}
}
request.setHeaders(headers);
return request;