Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- URL site = new URL("url");
- HttpURLConnection con = (HttpURLConnection)site.openConnection();
- con.setRequestMethod("POST");
- con.setDoOutput(true);
- BufferedWriter wr = new BufferedWriter(new OutputStreamWriter(con.getOutputStream()));
- String args = "report=" + json.toString() + "&secret="+ md5(playermp.username + "zWdNvkp0xU6P11rE0KZXN0H07qMx3kVnz1xBv0pbxzxO");
- System.out.println(args);
- wr.write(args);
- wr.flush();
- Scanner httpResponseScanner = new Scanner(con.getInputStream()); //Создаем сканнер для получения ответ от веб-сервера
- String response = "";
- while(httpResponseScanner.hasNext())
- {
- response = response + httpResponseScanner.nextLine();
- }
- httpResponseScanner.close();
- System.out.println("Response: " + response);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement