public interface ClientService
| Modifier and Type | Method and Description |
|---|---|
Optional<org.apache.http.client.methods.HttpGet> |
buildGetAcceptionApplicatonJson(String endpoint,
String authToken)
builds a HttpGet request object for the given endpoint using authToken as basic authentication header.
|
Optional<org.apache.http.client.methods.HttpGet> |
buildGetRequestUsingFormUrlEncoding(String endpoint,
String authToken)
Builds a HttpGet request object for the endpoint given by endpoint using authToken as basic authentication header
|
Optional<org.apache.http.client.methods.HttpGet> |
buildGetRequestUsingFormUrlEncoding(String endpoint,
String authToken,
org.apache.http.NameValuePair... params)
builds a HttpGet request object for the given endpoint using authToken as basic authentication header and params
as additional URL key/value parameters
|
Optional<org.apache.http.client.methods.HttpPost> |
buildPostRequestUsingApplicationJson(String endpoint,
org.apache.http.HttpEntity body)
builds a HttpPost request object for the given endpoint containing the provided body content
body will be posted using Content-Type of application/json
|
Optional<org.apache.http.client.methods.HttpPost> |
buildPostRequestUsingFormUrlEncoding(String endpoint,
String authToken,
org.apache.http.NameValuePair... params)
builds a HttpPost request object for the given endpoint containing the provided body content
body will be posted using Content-Type as application/x-www-form-urlencoded
|
Optional<org.json.JSONObject> |
executeJsonRequest(org.apache.http.client.methods.HttpRequestBase request)
executes the provided HttpRequestBase returning the result as a JSONObject
|
Optional<org.json.JSONObject> executeJsonRequest(org.apache.http.client.methods.HttpRequestBase request)
request - the request to send/executeOptional<org.apache.http.client.methods.HttpGet> buildGetRequestUsingFormUrlEncoding(String endpoint, String authToken)
endpoint - endpoint to perform get request onauthToken - authorization token for basic authenticationIllegalArgumentException - when either endpoint or authToken are null or emptyOptional<org.apache.http.client.methods.HttpGet> buildGetRequestUsingFormUrlEncoding(String endpoint, String authToken, org.apache.http.NameValuePair... params)
endpoint - endpoint to perform get request onauthToken - authorization token for basic authenticationparams - name/value pairs encoded and added to endpointIllegalArgumentException - when either endpoint or authToken are null or emptyOptional<org.apache.http.client.methods.HttpGet> buildGetAcceptionApplicatonJson(String endpoint, String authToken)
endpoint - endpoint to perform get request onauthToken - authorization token for basic authenticationIllegalArgumentException - when either endpoint or authToken are null or emptyOptional<org.apache.http.client.methods.HttpPost> buildPostRequestUsingApplicationJson(String endpoint, org.apache.http.HttpEntity body)
endpoint - endpoint to perform post request onbody - JSON body to be sent with the requestOptional<org.apache.http.client.methods.HttpPost> buildPostRequestUsingFormUrlEncoding(String endpoint, String authToken, org.apache.http.NameValuePair... params)
endpoint - endpoint to perform post request onauthToken - authorization token for basic authenticationparams - name/value pairs sent as the entity of the requestCopyright © 2016–2021. All rights reserved.