Package org.attribyte.api.http
Class FormPostRequestBuilder
java.lang.Object
org.attribyte.api.http.RequestBuilder
org.attribyte.api.http.RequestBuilderWithParameters
org.attribyte.api.http.FormPostRequestBuilder
Builds immutable HTTP
POST requests with body specified as application/x-www-form-urlencoded parameters.
Parameters in the URI are not parsed.
-
Field Summary
Fields inherited from class org.attribyte.api.http.RequestBuilder
attributes, cookies, headers, uri -
Constructor Summary
ConstructorsConstructorDescriptionCreates aPOSTrequest builder.Creates aPOSTrequest builder. -
Method Summary
Modifier and TypeMethodDescriptionvoidaddParameter(String name, String value) Adds a parameter.voidaddParameters(Map<?, ?> parameters) Adds a map of parameters.create()Creates the immutable request after all headers, parameters and attributes are added.voidsetParameter(String name, String[] values) Adds a multi-valued parameter.Methods inherited from class org.attribyte.api.http.RequestBuilder
addAttribute, addAttributes, addCookie, addHeader, addHeaders, addHeaders
-
Constructor Details
-
FormPostRequestBuilder
Creates aPOSTrequest 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
Creates aPOSTrequest builder.- Parameters:
uri- The URI. If a query string is specified, it is preserved but parameters are ignored.
-
-
Method Details
-
create
Description copied from class:RequestBuilderCreates the immutable request after all headers, parameters and attributes are added.- Specified by:
createin classRequestBuilder- Returns:
- The request.
-
addParameter
Adds a parameter.- Parameters:
name- The parameter name.value- The parameter value.
-
setParameter
Adds a multi-valued parameter.- Parameters:
name- The parameter name.values- The parameter values.
-
addParameters
Adds a map of parameters.The
toStringmethod will be called on map keys to generate parameter names. Map values may beString,String[],Collection<String>.- Parameters:
parameters- The map of parameters.
-