try {
String path = MessageFormat.format(pathTemplate, pathParams.toArray());
final UriBuilder uriBuilder = UriBuilder.fromUri(target.getTransportAddress());
uriBuilder.path(path);
for (F.Tuple<String, String> queryParam : queryParams) {
uriBuilder.queryParam(queryParam._1, queryParam._2);
}
if (unauthenticated && sessionId != null) {
LOG.error("Both session() and unauthenticated() are set for this request, this is a bug, using session id.", new Throwable());
}