Class HttpClient


  • public class HttpClient
    extends Object
    HttpClient provides Client Object for Http Based communication.
    • Field Detail

      • RETRIABLE_ERROR_CODES

        public static final List<Integer> RETRIABLE_ERROR_CODES
    • Method Detail

      • getHttpClientBuilder

        public org.apache.http.impl.client.HttpClientBuilder getHttpClientBuilder​(Integer maxRetryCount)
        Returns HttpClientBuilder instance.
        Parameters:
        maxRetryCount - maximum count of retries
      • buildPOSTRequest

        public org.apache.http.client.methods.HttpPost buildPOSTRequest​(String url,
                                                                        String jsonReq,
                                                                        String accessToken)
        Build POST Request Client.
        Parameters:
        url - http url that should be accessed.
        jsonReq - request payload.
        accessToken - OAuth access token.
      • buildGETRequest

        public org.apache.http.client.methods.HttpGet buildGETRequest​(String url,
                                                                      String accessToken)
        Builds GET Request Client.
        Parameters:
        url - http url that should be accessed.
        accessToken - OAuth access token.