get方式:
URL url = new URL(url2);
Reader reader = new InputStreamReader(new BufferedInputStream(url.openStream()), "UTF-8");
int c;
while ((c = reader.read()) != -1) {
System.out.print((char) c);
}
reader.close();
return null;
post方式:
HttpPost httppost = new HttpPost(URL_Leave_RESULT + applyId);
List<NameValuePair> params = new ArrayList<NameValuePair>();
params.add(new BasicNameValuePair("apikey", apikey));
params.add(new BasicNameValuePair("userToken", userToken));
params.add(new BasicNameValuePair("passed", passed));
params.add(new BasicNameValuePair("dealReason", dealReason));
httppost.setEntity(new UrlEncodedFormEntity(params, "UTF-8"));
HttpResponse response = new DefaultHttpClient().execute(httppost);
if (response.getStatusLine().getStatusCode() == 200) {
System.out.println("审批操作完成!");
return "";
}
return "";