public class FormSubmitter
extends java.lang.Object
implements com.aspose.ms.System.IDisposable
This class allows to prepare specified HTMLFormElement
, collects values from the form element, submit them to the remote server and receives a response.
Modifier and Type | Class and Description |
---|---|
static class |
FormSubmitter.Value |
Constructor and Description |
---|
FormSubmitter(FormEditor editor)
Initializes a new instance of the
FormSubmitter class. |
FormSubmitter(HTMLDocument document,
int index)
Initializes a new instance of the
FormSubmitter class based on HTMLFormElement selected by index from HTMLDocument . |
FormSubmitter(HTMLDocument document,
java.lang.String id)
Initializes a new instance of the
FormSubmitter class based on HTMLFormElement selected by identifier from HTMLDocument . |
FormSubmitter(HTMLFormElement form)
Initializes a new instance of the
FormSubmitter class based on HTMLFormElement . |
Modifier and Type | Method and Description |
---|---|
void |
dispose()
Releases unmanaged and - optionally - managed resources.
|
java.lang.String |
getAction()
Server-side form handler.
|
HttpMethod |
getMethod() |
void |
setAction(java.lang.String value)
Server-side form handler.
|
void |
setMethod(HttpMethod value) |
SubmissionResult |
submit()
Submits the form data to the server.
|
SubmissionResult |
submit(com.aspose.ms.System.Net.CookieContainer cookieContainer)
Submits the form data to the server with specified cookies.
|
SubmissionResult |
submit(com.aspose.ms.System.Net.ICredentials credentials)
Submits the form data to the server with specified user credentials.
|
SubmissionResult |
submit(com.aspose.ms.System.Net.ICredentials credentials,
com.aspose.ms.System.Net.CookieContainer cookieContainer)
Submits the form data to the server with specified user credentials and cookies.
|
SubmissionResult |
submit(com.aspose.ms.System.Net.ICredentials credentials,
com.aspose.ms.System.TimeSpan timeout)
Submits the form data to the server with specified user credentials and timeout.
|
SubmissionResult |
submit(com.aspose.ms.System.Net.ICredentials credentials,
com.aspose.ms.System.TimeSpan timeout,
boolean preAuthenticate)
Submits the form data to the server with specified user credentials.
|
SubmissionResult |
submit(com.aspose.ms.System.Net.ICredentials credentials,
com.aspose.ms.System.TimeSpan timeout,
boolean preAuthenticate,
com.aspose.ms.System.Net.CookieContainer cookieContainer)
Submits the form data to the server with specified user credentials and cookies.
|
SubmissionResult |
submit(com.aspose.ms.System.Net.ICredentials credentials,
com.aspose.ms.System.TimeSpan timeout,
com.aspose.ms.System.Net.CookieContainer cookieContainer)
Submits the form data to the server with specified user credentials, timeout and cookies.
|
SubmissionResult |
submit(com.aspose.ms.System.TimeSpan timeout)
Submits the form data to the server with specified timeout.
|
SubmissionResult |
submit(com.aspose.ms.System.TimeSpan timeout,
com.aspose.ms.System.Net.CookieContainer cookieContainer)
Submits the form data to the server with specified timeout and cookies.
|
public FormSubmitter(HTMLFormElement form)
Initializes a new instance of the FormSubmitter
class based on HTMLFormElement
.
form
- The html form element.public FormSubmitter(HTMLDocument document, int index)
Initializes a new instance of the FormSubmitter
class based on HTMLFormElement
selected by index from HTMLDocument
.
document
- The HTML document.index
- The index of the form.public FormSubmitter(HTMLDocument document, java.lang.String id)
Initializes a new instance of the FormSubmitter
class based on HTMLFormElement
selected by identifier from HTMLDocument
.
document
- The HTML document.id
- The element identifier.public FormSubmitter(FormEditor editor)
Initializes a new instance of the FormSubmitter
class.
editor
- The FormEditor.public HttpMethod getMethod()
public void setMethod(HttpMethod value)
public java.lang.String getAction()
Server-side form handler. See the action attribute definition in HTML 4.01.
public void setAction(java.lang.String value)
Server-side form handler. See the action attribute definition in HTML 4.01.
public SubmissionResult submit()
Submits the form data to the server.
public SubmissionResult submit(com.aspose.ms.System.Net.CookieContainer cookieContainer)
Submits the form data to the server with specified cookies.
cookieContainer
- The cookie container.public SubmissionResult submit(com.aspose.ms.System.Net.ICredentials credentials)
Submits the form data to the server with specified user credentials.
credentials
- The authentication information for the request.public SubmissionResult submit(com.aspose.ms.System.Net.ICredentials credentials, com.aspose.ms.System.Net.CookieContainer cookieContainer)
Submits the form data to the server with specified user credentials and cookies.
credentials
- The authentication information for the request.cookieContainer
- The cookie container.public SubmissionResult submit(com.aspose.ms.System.TimeSpan timeout)
Submits the form data to the server with specified timeout.
timeout
- The number of milliseconds to wait before the request times out.public SubmissionResult submit(com.aspose.ms.System.TimeSpan timeout, com.aspose.ms.System.Net.CookieContainer cookieContainer)
Submits the form data to the server with specified timeout and cookies.
timeout
- The number of milliseconds to wait before the request times out.cookieContainer
- The cookie container.public SubmissionResult submit(com.aspose.ms.System.Net.ICredentials credentials, com.aspose.ms.System.TimeSpan timeout)
Submits the form data to the server with specified user credentials and timeout.
credentials
- The authentication information for the request.timeout
- The number of milliseconds to wait before the request times out.public SubmissionResult submit(com.aspose.ms.System.Net.ICredentials credentials, com.aspose.ms.System.TimeSpan timeout, com.aspose.ms.System.Net.CookieContainer cookieContainer)
Submits the form data to the server with specified user credentials, timeout and cookies.
credentials
- The authentication information for the request.timeout
- The number of milliseconds to wait before the request times out.cookieContainer
- The cookie container.public SubmissionResult submit(com.aspose.ms.System.Net.ICredentials credentials, com.aspose.ms.System.TimeSpan timeout, boolean preAuthenticate)
Submits the form data to the server with specified user credentials.
credentials
- The authentication information for the request.timeout
- The number of milliseconds to wait before the request times out.preAuthenticate
- The value that indicates whether to send an Authorization header with the request.public SubmissionResult submit(com.aspose.ms.System.Net.ICredentials credentials, com.aspose.ms.System.TimeSpan timeout, boolean preAuthenticate, com.aspose.ms.System.Net.CookieContainer cookieContainer)
Submits the form data to the server with specified user credentials and cookies.
credentials
- The authentication information for the request.timeout
- The number of milliseconds to wait before the request times out.preAuthenticate
- The value that indicates whether to send an Authorization header with the request.cookieContainer
- The cookie container.public void dispose()
Releases unmanaged and - optionally - managed resources.
dispose
in interface com.aspose.ms.System.IDisposable