private static HttpOptions getHttpOptions(ClientConfiguration config, String url, String cookie, String userAgent, Map<String, String> headers) {
HttpOptions httpget = new HttpOptions(url);
RequestConfig requestConfig = config.getRequestConfig();
httpget.setConfig(requestConfig);
if(config.getKeepAlive()>0)
httpget.addHeader("Connection", "Keep-Alive");
if (headers != null && headers.size() > 0) {
Iterator<Entry<String, String>> entries = headers.entrySet().iterator();
while (entries.hasNext()) {
Entry<String, String> entry = entries.next();
httpget.addHeader(entry.getKey(), entry.getValue());
}
}
return httpget;
}