Ejemplo n.º 1
0
 private String issueHttpRequest(String command, String content) {
   String url = driver.getUrl() + "/i/" + command + ".command";
   HttpClient client = this.httpClient;
   HttpPost request = prepareRequest(content, url);
   String body = null;
   try {
     HttpResponse response = client.execute(request);
     body = fetchResponseBody(response);
   } catch (SocketTimeoutException ste) {
     LOGGER.error("fail to POST driver while execute trigger");
   } catch (ConnectTimeoutException cte) {
     LOGGER.error("fail to POST driver while execute trigger");
   } catch (Exception e) {
     LOGGER.error("fail to POST driver while execute trigger");
   }
   return body; // HTTP response body retrieved
 }