if (request == null) {
throw new IllegalArgumentException("HTTP request may not be null");
}
if (!request.containsHeader(HTTP.USER_AGENT)) {
String useragent = HttpProtocolParams.getUserAgent(request.getParams());
if (useragent != null) {
request.addHeader(HTTP.USER_AGENT, useragent);
}
}