- URLConnection uc = new URL("https://" + getServerName() + FindUserPage.PATH).openConnection();
- uc.addRequestProperty("Cookie", cookie);
- String csrf = getCSRF(uc, 0);
-
- uc = new URL("https://" + getServerName() + FindUserPage.PATH).openConnection();
- uc.addRequestProperty("Cookie", cookie);
- uc.setDoOutput(true);
- OutputStream os = uc.getOutputStream();
- os.write(("csrf=" + URLEncoder.encode(csrf, "UTF-8") + "&" //
- + "process&email=" + URLEncoder.encode(createUniqueName() + "@example.org", "UTF-8")).getBytes("UTF-8"));
- os.flush();
+ URLConnection uc = post(cookie, FindUserPage.PATH, "process&email=" + URLEncoder.encode(createUniqueName() + "@example.org", "UTF-8"), 0);
+