com.aspose.html.forms

Class FormSubmitter

  • java.lang.Object
    • com.aspose.html.forms.FormSubmitter
  • All Implemented Interfaces:
    com.aspose.ms.System.IDisposable


    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.

    • Nested Class Summary

      Nested Classes 
      Modifier and Type Class and Description
      static class  FormSubmitter.Value 
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      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.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • FormSubmitter

        public FormSubmitter(HTMLDocument document,
                             int index)

        Initializes a new instance of the FormSubmitter class based on HTMLFormElement selected by index from HTMLDocument.

        Parameters:
        document - The HTML document.
        index - The index of the form.
      • FormSubmitter

        public FormSubmitter(HTMLDocument document,
                             java.lang.String id)

        Initializes a new instance of the FormSubmitter class based on HTMLFormElement selected by identifier from HTMLDocument.

        Parameters:
        document - The HTML document.
        id - The element identifier.
      • FormSubmitter

        public FormSubmitter(FormEditor editor)

        Initializes a new instance of the FormSubmitter class.

        Parameters:
        editor - The FormEditor.
    • Method Detail

      • setMethod

        public void setMethod(HttpMethod value)
      • getAction

        public java.lang.String getAction()

        Server-side form handler. See the action attribute definition in HTML 4.01.

      • setAction

        public void setAction(java.lang.String value)

        Server-side form handler. See the action attribute definition in HTML 4.01.

      • submit

        public SubmissionResult submit()

        Submits the form data to the server.

        Returns:
        The result of the submission.
      • submit

        public SubmissionResult submit(com.aspose.ms.System.Net.CookieContainer cookieContainer)

        Submits the form data to the server with specified cookies.

        Parameters:
        cookieContainer - The cookie container.
        Returns:
        The result of the submission.
      • submit

        public SubmissionResult submit(com.aspose.ms.System.Net.ICredentials credentials)

        Submits the form data to the server with specified user credentials.

        Parameters:
        credentials - The authentication information for the request.
        Returns:
        The result of the submission.
      • submit

        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.

        Parameters:
        credentials - The authentication information for the request.
        cookieContainer - The cookie container.
        Returns:
        The result of the submission.
      • submit

        public SubmissionResult submit(com.aspose.ms.System.TimeSpan timeout)

        Submits the form data to the server with specified timeout.

        Parameters:
        timeout - The number of milliseconds to wait before the request times out.
        Returns:
        The result of the submission.
      • submit

        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.

        Parameters:
        timeout - The number of milliseconds to wait before the request times out.
        cookieContainer - The cookie container.
        Returns:
        The result of the submission.
      • submit

        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.

        Parameters:
        credentials - The authentication information for the request.
        timeout - The number of milliseconds to wait before the request times out.
        Returns:
        The result of the submission.
      • submit

        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.

        Parameters:
        credentials - The authentication information for the request.
        timeout - The number of milliseconds to wait before the request times out.
        cookieContainer - The cookie container.
        Returns:
        The result of the submission.
      • submit

        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.

        Parameters:
        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.
        Returns:
        The result of the submission.
      • submit

        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.

        Parameters:
        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.
        Returns:
        The result of the submission.
      • dispose

        public void dispose()

        Releases unmanaged and - optionally - managed resources.

        Specified by:
        dispose in interface com.aspose.ms.System.IDisposable