View Javadoc

1   package com.atlassian.httpclient.api;
2   
3   import java.util.List;
4   
5   /**
6    * Builds url-encoded form entities for use as HTTP request message bodies.
7    * URL encoding of parameter names and values is handled by FormBuilder implementations.
8    */
9   public interface FormBuilder extends EntityBuilder {
10      /**
11       * Adds a valueless parameter.
12       *
13       * @param name The name of the parameter
14       * @return This object, for builder-style chaining
15       */
16      public FormBuilder addParam(String name);
17  
18      /**
19       * Adds a parameter and its value.
20       *
21       * @param name  The name of the parameter
22       * @param value The value of the parameter
23       * @return This object, for builder-style chaining
24       */
25      public FormBuilder addParam(String name, String value);
26  
27      /**
28       * Sets multiple values for the named parameter, resetting any existing values in the process.
29       *
30       * @param name   The name of the parameter
31       * @param values A list of all values for the named the parameter
32       * @return This object, for builder-style chaining
33       */
34      public FormBuilder setParam(String name, List<String> values);
35  }