use of com.ctrip.platform.dal.daogen.entity.Response in project dal by ctripcorp.
the class WebUtil method getAllInOneResponse.
public static Response getAllInOneResponse(String keyname, String environment) throws Exception {
Response res = null;
if (keyname == null || keyname.isEmpty())
return res;
if (SERVICE_RUL == null || SERVICE_RUL.isEmpty())
return res;
if (APP_ID == null || APP_ID.isEmpty())
return res;
try {
URIBuilder builder = new URIBuilder(SERVICE_RUL).addParameter("ids", keyname).addParameter("appid", APP_ID);
if (environment != null && !environment.isEmpty())
builder.addParameter("envt", environment);
URI uri = builder.build();
HttpClient sslClient = initWeakSSLClient();
if (sslClient != null) {
HttpGet httpGet = new HttpGet();
httpGet.setURI(uri);
HttpResponse response = sslClient.execute(httpGet);
HttpEntity entity = response.getEntity();
String content = EntityUtils.toString(entity);
res = JSON.parseObject(content, Response.class);
}
return res;
} catch (Throwable e) {
throw e;
}
}
Aggregations