public abstract class BaseRequests extends Object
| Modifier and Type | Field and Description |
|---|---|
protected String |
baseUrl |
protected org.apache.http.impl.client.CloseableHttpClient |
client |
protected com.google.gson.Gson |
gson |
| Modifier | Constructor and Description |
|---|---|
protected |
BaseRequests(String baseUrl) |
| Modifier and Type | Method and Description |
|---|---|
protected String |
getDefaultErrorMessage(org.apache.http.client.methods.CloseableHttpResponse response) |
protected void |
processErrorResponse(org.apache.http.client.methods.CloseableHttpResponse response) |
protected <T> T |
processResponse(org.apache.http.client.methods.CloseableHttpResponse response,
Class<T> responseClass) |
protected org.apache.http.client.methods.CloseableHttpResponse |
sendDelete(String path) |
protected org.apache.http.client.methods.CloseableHttpResponse |
sendJSONGet(String path) |
protected org.apache.http.client.methods.CloseableHttpResponse |
sendJSONGet(String path,
Map<String,Object> parameters) |
protected org.apache.http.client.methods.CloseableHttpResponse |
sendJSONPost(String path,
Object message) |
protected org.apache.http.client.methods.CloseableHttpResponse |
sendJSONPut(String path,
Object message) |
protected org.apache.http.client.methods.CloseableHttpResponse |
sendMultiPartEntity(String path,
Map<String,String> headers,
org.apache.http.HttpEntity entity) |
protected org.apache.http.impl.client.CloseableHttpClient client
protected String baseUrl
protected com.google.gson.Gson gson
protected BaseRequests(String baseUrl)
protected org.apache.http.client.methods.CloseableHttpResponse sendJSONPost(String path, Object message) throws IOException
IOExceptionprotected org.apache.http.client.methods.CloseableHttpResponse sendMultiPartEntity(String path, Map<String,String> headers, org.apache.http.HttpEntity entity) throws IOException
IOExceptionprotected org.apache.http.client.methods.CloseableHttpResponse sendJSONGet(String path) throws IOException
IOExceptionprotected org.apache.http.client.methods.CloseableHttpResponse sendJSONGet(String path, Map<String,Object> parameters) throws IOException, URISyntaxException
IOExceptionURISyntaxExceptionprotected org.apache.http.client.methods.CloseableHttpResponse sendDelete(String path) throws IOException
IOExceptionprotected org.apache.http.client.methods.CloseableHttpResponse sendJSONPut(String path, Object message) throws IOException
IOExceptionprotected String getDefaultErrorMessage(org.apache.http.client.methods.CloseableHttpResponse response)
protected <T> T processResponse(org.apache.http.client.methods.CloseableHttpResponse response,
Class<T> responseClass)
throws IOException,
AnglesServerException
IOExceptionAnglesServerExceptionprotected void processErrorResponse(org.apache.http.client.methods.CloseableHttpResponse response)
throws AnglesServerException
AnglesServerExceptionCopyright © 2021. All rights reserved.