Package org.hisp.dhis
Class Dhis2AsyncRequest
java.lang.Object
org.hisp.dhis.Dhis2AsyncRequest
-
Constructor Summary
ConstructorsConstructorDescriptionDhis2AsyncRequest(Dhis2Config config, org.apache.hc.client5.http.impl.classic.CloseableHttpClient httpClient, com.fasterxml.jackson.databind.ObjectMapper objectMapper) -
Method Summary
Modifier and TypeMethodDescription<T extends BaseHttpResponse>
TExecutes the given HTTP POST request.
-
Constructor Details
-
Dhis2AsyncRequest
public Dhis2AsyncRequest(Dhis2Config config, org.apache.hc.client5.http.impl.classic.CloseableHttpClient httpClient, com.fasterxml.jackson.databind.ObjectMapper objectMapper)
-
-
Method Details
-
post
public <T extends BaseHttpResponse> T post(org.apache.hc.client5.http.classic.methods.HttpPost request, Class<T> klass) Executes the given HTTP POST request. The request must be a DHIS 2 async request. The method will use the DHIS 2 tasks and task summary API endpoints to poll for the task status, and eventually return a task summary when the task is complete.- Type Parameters:
T- the class type.- Parameters:
request- theHttpPost.klass- the class type.- Returns:
- a response message.
- Throws:
Dhis2ClientException- if the POST operation failed.
-