Interface HttpClientForm


public interface HttpClientForm
An HTTP Form builder.
  • Method Details

    • attr

      HttpClientForm attr(String name, String value)
      Add an HTTP Form attribute.
      Parameters:
      name - Attribute name
      value - Attribute value
      Returns:
      this builder
    • charset

      HttpClientForm charset(Charset charset)
      Set the Form Charset.
      Parameters:
      charset - form charset
      Returns:
      this builder
    • cleanOnTerminate

      HttpClientForm cleanOnTerminate(boolean clean)
      Should file attributes be cleaned and eventually removed from disk. Default to true.

      If the default HttpDataFactory is in use, the data is always cleaned, as it cannot be accessed outside the form. To keep the data, use factory(HttpDataFactory) to configure a custom HttpDataFactory.

      Parameters:
      clean - true if cleaned on termination (successful or failed)
      Returns:
      this builder
    • encoding

      Set Form encoding.
      Parameters:
      mode - the encoding mode for this form encoding
      Returns:
      this builder
    • factory

      HttpClientForm factory(HttpDataFactory factory)
      Set Upload factories (allows memory threshold configuration).
      Parameters:
      factory - the new HttpDataFactory to use
      Returns:
      this builder
    • file

      HttpClientForm file(String name, File file)
      Add an HTTP File Upload attribute.
      Parameters:
      name - File name
      file - File reference
      Returns:
      this builder
    • file

      HttpClientForm file(String name, InputStream stream)
      Add an HTTP File Upload attribute.
      Parameters:
      name - File name
      stream - File content as InputStream
      Returns:
      this builder
    • file

      default HttpClientForm file(String name, File file, @Nullable String contentType)
      Add an HTTP File Upload attribute.
      Parameters:
      name - File name
      file - File reference
      contentType - File mime-type
      Returns:
      this builder
    • file

      HttpClientForm file(String name, String filename, File file, @Nullable String contentType)
      Add an HTTP File Upload attribute.
      Parameters:
      name - File name
      filename - File name to override origin name
      file - File reference
      contentType - File mime-type
      Returns:
      this builder
    • file

      default HttpClientForm file(String name, InputStream stream, @Nullable String contentType)
      Add an HTTP File Upload attribute.
      Parameters:
      name - File name
      stream - File content as InputStream
      contentType - File mime-type
      Returns:
      this builder
    • file

      HttpClientForm file(String name, String filename, InputStream stream, @Nullable String contentType)
      Add an HTTP File Upload attribute.
      Parameters:
      name - File name
      filename - File name to override origin name
      stream - File content as InputStream
      contentType - File mime-type
      Returns:
      this builder
    • files

      HttpClientForm files(String name, File[] files, String[] contentTypes)
      Add an HTTP File Upload attribute.
      Parameters:
      name - File name
      files - File references
      contentTypes - File mime-types in the same order than file references
      Returns:
      this builder
    • files

      HttpClientForm files(String name, File[] files, String[] contentTypes, boolean[] textFiles)
      Add an HTTP File Upload attribute.
      Parameters:
      name - File name
      files - File references
      contentTypes - File mime-type in the same order than file references
      textFiles - Plain-Text transmission in the same order than file references
      Returns:
      this builder
    • multipart

      HttpClientForm multipart(boolean multipart)
      Define if this request will be encoded as Multipart.
      Parameters:
      multipart - should this form be encoded as Multipart
      Returns:
      this builder
    • textFile

      HttpClientForm textFile(String name, File file)
      Add an HTTP File Upload attribute for a text file.
      Parameters:
      name - Text file name
      file - Text File reference
      Returns:
      this builder
    • textFile

      HttpClientForm textFile(String name, InputStream stream)
      Add an HTTP File Upload attribute for a text file.
      Parameters:
      name - Text file name
      stream - Text file content as InputStream
      Returns:
      this builder
    • textFile

      HttpClientForm textFile(String name, File file, @Nullable String contentType)
      Add an HTTP File Upload attribute for a text file.
      Parameters:
      name - Text file name
      file - Text File reference
      contentType - Text file mime-type
      Returns:
      this builder
    • textFile

      HttpClientForm textFile(String name, InputStream inputStream, @Nullable String contentType)
      Add an HTTP File Upload attribute for a text file.
      Parameters:
      name - Text file name
      inputStream - Text file content as InputStream
      contentType - Text file mime-type
      Returns:
      this builder