protected <T> URI buidURI(Request<T> request){
URL url = null;
try {
url = api.getURL();
} catch (MalformedURLException e) {
throw new ClientException(e);
}
String path = inquirePath(request);
Map<String,String> qry = RequestUtil.resolveQueryPart(request);
Set<String> keys = qry.keySet();
String query = "";
if(!keys.isEmpty()){
for(String key : keys){
query += (!query.isEmpty()?"&":"?")+key+"="+qry.get(key);
}
}
String fqrn = url.toString() + path + query;
try {
return new URI(fqrn);
} catch (URISyntaxException e) {
throw new ClientException(e);
}
}