HttpURLConnection conn = null; try { URL url = new URL("http://192.168.10.30:8082/XXX/aaa"); conn = (HttpURLConnection) url.openConnection(); conn.setRequestProperty("Content-Type", "application/json; charset=UTF-8"); conn.setRequestProperty("Connection", "close"); conn.setRequestMethod("POST"); conn.setDoOutput(true); conn.setRequestProperty("Authorization", token); DataOutputStream wr = new DataOutputStream(conn.getOutputStream()); JSONObject json = new JSONObject(); json.put("storeId", "002"); wr.writeBytes(json.toString()); wr.flush(); wr.close(); int statusCode = conn.getResponseCode(); BufferedReader reader = new BufferedReader(new InputStreamReader(conn.getInputStream())); String printInfo = reader.readLine(); } catch (Exception ex) { String aa = ex.getMessage(); } finally { if (conn != null) { conn.disconnect(); } }