{"id":65,"check":1,"date":"08-Jan-19"}
{"id":"65check=1","check":null,"date":"08-Jan-19"}
Attendance_TimeCheck = "1"; users_identify = "65"; try { URL urlForPostRequest = new URL("http://xenzet.com/ds/getrec.php"); System.out.println("Instantiated new URL: " + urlForPostRequest); final long id = Long.valueOf(users_identify); HttpURLConnection conection = (HttpURLConnection) urlForPostRequest.openConnection(); conection.setDoOutput(true); conection.setRequestMethod("POST"); conection.setRequestProperty("User-Agent", "Mozilla/5.0"); conection.getOutputStream().write(("id="+id).getBytes(StandardCharsets.UTF_8)); conection.getOutputStream().write(("check="+Attendance_TimeCheck).getBytes(StandardCharsets.UTF_8)); conection.connect(); BufferedInputStream bis = new BufferedInputStream(conection.getInputStream()); ByteArrayOutputStream bos = new ByteArrayOutputStream(); int resultBuffer = bis.read(); while (resultBuffer != -1) { bos.write((byte) resultBuffer); resultBuffer = bis.read(); } String result1 = bos.toString(); System.out.println(result1); } catch (Exception ex) { ex.printStackTrace(); }
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)