Advertisement
Guest User

Untitled

a guest
Feb 24th, 2020
113
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.45 KB | None | 0 0
  1. URL url = new URL("https://student.psu.ru/pls/stu_cus_et/stu.login");
  2. HttpsURLConnection connection = (HttpsURLConnection)url.openConnection();
  3.  
  4. String params = "p_redirect=stu.teach_plan&p_username="+URLEncoder.encode(login, "windows-1251")+"&p_password="+password;
  5. connection.setRequestMethod("POST");
  6. connection.setDoOutput(true);
  7. DataOutputStream wr = new DataOutputStream(connection.getOutputStream());
  8. wr.writeBytes(params);
  9. wr.flush();
  10. wr.close();
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement