Class FormPostRequestBuilder


public class FormPostRequestBuilder extends RequestBuilderWithParameters
Builds immutable HTTP POST requests with body specified as application/x-www-form-urlencoded parameters.

Parameters in the URI are not parsed.

  • Constructor Details

    • FormPostRequestBuilder

      public FormPostRequestBuilder(String uri) throws org.attribyte.api.InvalidURIException
      Creates a POST request builder.
      Parameters:
      uri - The URI. If a query string is specified, it is preserved but parameters are ignored.
      Throws:
      org.attribyte.api.InvalidURIException - if URI is invalid.
    • FormPostRequestBuilder

      public FormPostRequestBuilder(URI uri)
      Creates a POST request builder.
      Parameters:
      uri - The URI. If a query string is specified, it is preserved but parameters are ignored.
  • Method Details

    • create

      public Request create()
      Description copied from class: RequestBuilder
      Creates the immutable request after all headers, parameters and attributes are added.
      Specified by:
      create in class RequestBuilder
      Returns:
      The request.
    • addParameter

      public void addParameter(String name, String value)
      Adds a parameter.
      Parameters:
      name - The parameter name.
      value - The parameter value.
    • setParameter

      public void setParameter(String name, String[] values)
      Adds a multi-valued parameter.
      Parameters:
      name - The parameter name.
      values - The parameter values.
    • addParameters

      public void addParameters(Map<?,?> parameters)
      Adds a map of parameters.

      The toString method will be called on map keys to generate parameter names. Map values may be String, String[], Collection<String>.

      Parameters:
      parameters - The map of parameters.