request.addHeader(header.getName(), value);
}
private HttpRequestBase composeGetRequest(String uri, final Parameters parameters) {
try {
URIBuilder builder = new URIBuilder(uri);
for(Parameter param : parameters)
if(param.isSingleValue())
builder.setParameter(param.getName(), param.getValue());
else
for(String value : param.getValues())
builder.addParameter(param.getName(), value);
URI requestURI = builder.build();
uri = requestURI.toString();
return new HttpGet(requestURI);
}
catch(URISyntaxException e) {
throw MechanizeExceptionFactory.newException(e);