in src/main/java/org/apache/sling/hapi/client/impl/microdata/MicrodataDocument.java [293:325]
public Document submit(Iterable<NameValuePair> values) throws ClientException {
if (el.tagName().equalsIgnoreCase("form")) {
String action = el.attr("abs:action");
if (action.length() == 0) {
action = el.baseUri();
}
String method = el.attr("method");
if (method.length() == 0 || method.equalsIgnoreCase("get")) {
FormValues query = new FormValues(el, values);
String url = action + (action.contains("?") ? "?" : "&") + query.toString();
return document.client.enter(url);
}
if (method.equalsIgnoreCase("post")) {
String enctype = el.attr("enctype");
FormValues v = new FormValues(el, values);
if (enctype.length() == 0 || enctype.equalsIgnoreCase("application/x-www-form-urlencoded")) {
return document.client.post(action, v.toUrlEncodedEntity());
} else if (enctype.equalsIgnoreCase("multipart/form-data")) {
return document.client.post(action, v.toMultipartEntity());
}
throw new ClientException("Unsupported form enctype: " + enctype);
}
throw new ClientException("Unsupported form method: " + method);
}
throw new ClientException("The item is not a form");
}