Package com.oorian.apis
Class UrlEncodedRequest
java.lang.Object
com.oorian.apis.ApiHttpRequest
com.oorian.apis.UrlEncodedRequest
- Direct Known Subclasses:
UrlEncodedPostRequest,UrlEncodedPutRequest
Abstract base class for HTTP requests with URL-encoded form parameters.
Serializes parameters in application/x-www-form-urlencoded format.
Subclasses specify the HTTP method (POST or PUT).
-
Field Summary
Fields inherited from class com.oorian.apis.ApiHttpRequest
DELETE, GET, POST, PUT -
Constructor Summary
ConstructorsConstructorDescriptionUrlEncodedRequest(int method, String url) Creates a new URL-encoded request with the specified HTTP method and URL. -
Method Summary
Modifier and TypeMethodDescriptionvoidaddParameter(RequestParameter param) Adds a form parameter to this request.voidaddParameter(String name, Object value) Adds a form parameter with the specified name and value.protected HttpRequest.BodyPublishergetData()Methods inherited from class com.oorian.apis.ApiHttpRequest
addHeader, addHeaders, getCharset, getHeaders, getResponse, getUrl, getUrlConnection, send, send, setCharset, setConnectTimeout, setContentType, setReadTimeout, setUrl
-
Constructor Details
-
UrlEncodedRequest
Creates a new URL-encoded request with the specified HTTP method and URL.- Parameters:
method- the HTTP method constant.url- the target URL.
-
-
Method Details
-
addParameter
Adds a form parameter with the specified name and value.- Parameters:
name- the parameter name.value- the parameter value.
-
addParameter
Adds a form parameter to this request.- Parameters:
param- the request parameter to add.
-
getData
- Specified by:
getDatain classApiHttpRequest- Throws:
HttpRequestException
-