Class UrlEncodedFormWriter


  • public class UrlEncodedFormWriter
    extends Object
    Represents a form writer that allows writing form fields that are URL encoded.
    • Constructor Detail

      • UrlEncodedFormWriter

        public UrlEncodedFormWriter()
        Constructs an UrlEncodedFormWriter.
    • Method Detail

      • addField

        public void addField​(String name,
                             String value)
                      throws IOException
        Writes a string field value.
        Parameters:
        name - the field name (required)
        value - the field value
        Throws:
        IOException - on input/output errors
      • write

        public void write​(OutputStream os)
                   throws IOException
        Writes the form data to the output stream.
        Parameters:
        os - The output stream
        Throws:
        IOException - on input/output errors
      • getLength

        public int getLength()
        Returns:
        the length of the url encoded form data