} catch (UnsupportedEncodingException e) {
debug_msg = debug_msg + "GET request: https://" + _ip + s_apiUri + queryString + "\n";
}
HttpGet get_request = new HttpGet("https://" + _ip + s_apiUri + queryString);
ResponseHandler<String> responseHandler = new BasicResponseHandler();
try {
responseBody = s_httpclient.execute(get_request, responseHandler);
} catch (IOException e) {
throw new ExecutionException(e.getMessage());
}
}
// a POST method...
if (method == PaloAltoMethod.POST) {
List<NameValuePair> nvps = new ArrayList<NameValuePair>();
for (String key : params.keySet()) {
nvps.add(new BasicNameValuePair(key, params.get(key)));
}
if (_key != null) {
nvps.add(new BasicNameValuePair("key", _key));
}
debug_msg = debug_msg + "POST request: https://" + _ip + s_apiUri + "\n";
for (NameValuePair nvp : nvps) {
debug_msg = debug_msg + "param: " + nvp.getName() + ", " + nvp.getValue() + "\n";
}
HttpPost post_request = new HttpPost("https://" + _ip + s_apiUri);
try {
post_request.setEntity(new UrlEncodedFormEntity(nvps, HTTP.UTF_8));
} catch (UnsupportedEncodingException e) {
throw new ExecutionException(e.getMessage());
}
ResponseHandler<String> responseHandler = new BasicResponseHandler();
try {
responseBody = s_httpclient.execute(post_request, responseHandler);
} catch (IOException e) {
throw new ExecutionException(e.getMessage());
}