Package com.oorian.apis
Class RawDataRequest
java.lang.Object
com.oorian.apis.ApiHttpRequest
com.oorian.apis.RawDataRequest
- Direct Known Subclasses:
RawDataPostRequest,RawDataPutRequest
Abstract base class for HTTP requests that send raw string data in the request body.
Subclasses specify the HTTP method (POST or PUT). The request body is set as a
raw string via setData(String).
-
Field Summary
Fields inherited from class com.oorian.apis.ApiHttpRequest
DELETE, GET, POST, PUT -
Constructor Summary
ConstructorsConstructorDescriptionRawDataRequest(int method) Creates a new raw data request with the specified HTTP method.RawDataRequest(int method, String url) Creates a new raw data request with the specified HTTP method and URL.RawDataRequest(int method, String url, String contentType) Creates a new raw data request with the specified HTTP method, URL, and content type. -
Method Summary
Modifier and TypeMethodDescriptionprotected HttpRequest.BodyPublishergetData()voidSets the raw string data to send in the request body.Methods inherited from class com.oorian.apis.ApiHttpRequest
addHeader, addHeaders, getCharset, getHeaders, getResponse, getUrl, getUrlConnection, send, send, setCharset, setConnectTimeout, setContentType, setReadTimeout, setUrl
-
Constructor Details
-
RawDataRequest
public RawDataRequest(int method) Creates a new raw data request with the specified HTTP method.- Parameters:
method- the HTTP method constant.
-
RawDataRequest
Creates a new raw data request with the specified HTTP method and URL.- Parameters:
method- the HTTP method constant.url- the target URL.
-
RawDataRequest
Creates a new raw data request with the specified HTTP method, URL, and content type.- Parameters:
method- the HTTP method constant.url- the target URL.contentType- the Content-Type header value.
-
-
Method Details
-
setData
Sets the raw string data to send in the request body.- Parameters:
postData- the request body data.
-
getData
- Specified by:
getDatain classApiHttpRequest- Throws:
HttpRequestException
-