use of org.alfresco.rest.api.tests.client.PublicApiHttpClient.RequestBuilder in project alfresco-remote-api by Alfresco.
the class AbstractBaseApiTest method delete.
protected HttpResponse delete(String url, String entityId, Map<String, String> params, Map<String, String> headers, String apiName, int expectedStatus) throws Exception {
RequestBuilder requestBuilder = httpClient.new DeleteRequestBuilder().setRequestContext(publicApiClient.getRequestContext()).setScope(getScope()).setApiName(apiName).setEntityCollectionName(url).setEntityId(entityId).setParams(params).setHeaders(headers);
HttpResponse response = publicApiClient.execute(requestBuilder);
checkStatus(expectedStatus, response.getStatusCode());
return response;
}
use of org.alfresco.rest.api.tests.client.PublicApiHttpClient.RequestBuilder in project alfresco-remote-api by Alfresco.
the class AbstractBaseApiTest method post.
protected HttpResponse post(String url, String body, Map<String, String> params, Map<String, String> headers, String apiName, int expectedStatus) throws Exception {
RequestBuilder requestBuilder = httpClient.new PostRequestBuilder().setBodyAsString(body).setRequestContext(publicApiClient.getRequestContext()).setScope(getScope()).setApiName(apiName).setEntityCollectionName(url).setHeaders(headers).setParams(params);
HttpResponse response = publicApiClient.execute(requestBuilder);
checkStatus(expectedStatus, response.getStatusCode());
return response;
}
use of org.alfresco.rest.api.tests.client.PublicApiHttpClient.RequestBuilder in project alfresco-remote-api by Alfresco.
the class AbstractBaseApiTest method post.
protected HttpResponse post(String url, byte[] body, Map<String, String> params, Map<String, String> headers, String apiName, String contentType, int expectedStatus) throws Exception {
RequestBuilder requestBuilder = httpClient.new PostRequestBuilder().setBodyAsByteArray(body).setContentType(contentType).setRequestContext(publicApiClient.getRequestContext()).setScope(getScope()).setApiName(apiName).setEntityCollectionName(url).setHeaders(headers).setParams(params);
HttpResponse response = publicApiClient.execute(requestBuilder);
checkStatus(expectedStatus, response.getStatusCode());
return response;
}
Aggregations