Class BaseRequests
- java.lang.Object
-
- com.github.angleshq.angles.api.requests.BaseRequests
-
- Direct Known Subclasses:
BuildRequests,EnvironmentRequests,ExecutionRequests,ScreenshotRequests,TeamRequests
public abstract class BaseRequests extends Object
-
-
Constructor Summary
Constructors Modifier Constructor Description protectedBaseRequests(String baseUrl)protectedBaseRequests(String baseUrl, org.apache.http.client.config.RequestConfig requestConfig)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected StringgetDefaultErrorMessage(org.apache.http.client.methods.CloseableHttpResponse response)protected voidprocessErrorResponse(org.apache.http.client.methods.CloseableHttpResponse response)protected <T> TprocessResponse(org.apache.http.client.methods.CloseableHttpResponse response, Class<T> responseClass)protected org.apache.http.client.methods.CloseableHttpResponsesendDelete(String path)protected org.apache.http.client.methods.CloseableHttpResponsesendJSONGet(String path)protected org.apache.http.client.methods.CloseableHttpResponsesendJSONGet(String path, Map<String,Object> parameters)protected org.apache.http.client.methods.CloseableHttpResponsesendJSONPost(String path, Object message)protected org.apache.http.client.methods.CloseableHttpResponsesendJSONPut(String path, Object message)protected org.apache.http.client.methods.CloseableHttpResponsesendMultiPartEntity(String path, Map<String,String> headers, org.apache.http.HttpEntity entity)
-
-
-
Field Detail
-
client
protected org.apache.http.impl.client.CloseableHttpClient client
-
baseUrl
protected String baseUrl
-
gson
protected com.google.gson.Gson gson
-
-
Method Detail
-
sendJSONPost
protected org.apache.http.client.methods.CloseableHttpResponse sendJSONPost(String path, Object message) throws IOException
- Throws:
IOException
-
sendMultiPartEntity
protected org.apache.http.client.methods.CloseableHttpResponse sendMultiPartEntity(String path, Map<String,String> headers, org.apache.http.HttpEntity entity) throws IOException
- Throws:
IOException
-
sendJSONGet
protected org.apache.http.client.methods.CloseableHttpResponse sendJSONGet(String path) throws IOException
- Throws:
IOException
-
sendJSONGet
protected org.apache.http.client.methods.CloseableHttpResponse sendJSONGet(String path, Map<String,Object> parameters) throws IOException, URISyntaxException
- Throws:
IOExceptionURISyntaxException
-
sendDelete
protected org.apache.http.client.methods.CloseableHttpResponse sendDelete(String path) throws IOException
- Throws:
IOException
-
sendJSONPut
protected org.apache.http.client.methods.CloseableHttpResponse sendJSONPut(String path, Object message) throws IOException
- Throws:
IOException
-
getDefaultErrorMessage
protected String getDefaultErrorMessage(org.apache.http.client.methods.CloseableHttpResponse response)
-
processResponse
protected <T> T processResponse(org.apache.http.client.methods.CloseableHttpResponse response, Class<T> responseClass) throws IOException, AnglesServerException- Throws:
IOExceptionAnglesServerException
-
processErrorResponse
protected void processErrorResponse(org.apache.http.client.methods.CloseableHttpResponse response) throws AnglesServerException- Throws:
AnglesServerException
-
-