}
public static String executeBasicWebInteraction(String cookie, String path, String query, int formIndex) throws IOException, MalformedURLException, UnsupportedEncodingException {
+ URLConnection uc = post(cookie, path, query, formIndex);
+ String error = fetchStartErrorMessage(IOUtils.readURL(uc));
+ return error;
+ }
+
+ public static HttpURLConnection post(String cookie, String path, String query, int formIndex) throws IOException, MalformedURLException, UnsupportedEncodingException {
URLConnection uc = new URL("https://" + getServerName() + path).openConnection();
uc.addRequestProperty("Cookie", cookie);
String csrf = getCSRF(uc, formIndex);
+ query//
).getBytes("UTF-8"));
os.flush();
- String error = fetchStartErrorMessage(IOUtils.readURL(uc));
- return error;
+ return (HttpURLConnection) uc;
+ }
+
+ public HttpURLConnection get(String cookie, String path, int formIndex) throws IOException {
+ URLConnection uc = new URL("https://" + getServerName() + path).openConnection();
+ uc.addRequestProperty("Cookie", cookie);
+ return (HttpURLConnection) uc;
}
public static EmailAddress createVerifiedEmail(User u) throws InterruptedException, GigiApiException {