Class HttpClient

    • Field Detail

      • HTTP_CLIENT_LOG_TAG

        public static final java.lang.String HTTP_CLIENT_LOG_TAG
        See Also:
        Constant Field Values
    • Constructor Detail

      • HttpClient

        public HttpClient​(java.net.URL url)
    • Method Detail

      • getConnectTimeout

        public final java.lang.Long getConnectTimeout()
        Return the connection timeout value.
        Returns:
        Connection timeout vaue.
      • setConnectTimeout

        public final void setConnectTimeout​(java.lang.Long connectTimeout)
        Set the connection timeout value.
        Parameters:
        connectTimeout - Connection timeout value.
      • getWriteTimeout

        public final java.lang.Long getWriteTimeout()
        Return the write timeout value.
        Returns:
        Write timeout value.
      • setWriteTimeout

        public final void setWriteTimeout​(java.lang.Long writeTimeout)
        Set the write timeout value.
        Parameters:
        writeTimeout - Write timeout value.
      • getReadTimeout

        public final java.lang.Long getReadTimeout()
        Return the read timeout value.
        Returns:
        Read timeout value.
      • setReadTimeout

        public final void setReadTimeout​(java.lang.Long readTimeout)
        Set the read timeout value.
        Parameters:
        readTimeout - Read timeout value.
      • addPath

        public void addPath​(java.lang.String... paths)
        Add path over base context of the constructor URI.
        Parameters:
        paths - Adding paths.
      • reset

        public final void reset()
        Return all the internal fields to the default values in order to reuse this client.
      • setBody

        public void setBody​(byte[] body)
        Set the request body.
        Parameters:
        body - Request body.
      • setHttpMethod

        public final void setHttpMethod​(HttpMethod method)
        Set the http method to request.
        Parameters:
        method - Http method.
      • addHttpHeader

        public final void addHttpHeader​(java.lang.String header)
        Add header to request.
        Parameters:
        header - Http header.
      • addHttpHeader

        public final void addHttpHeader​(HttpHeader header)
        Add header to request.
        Parameters:
        header - Http header.
      • isHttpsInsecureConnection

        public java.lang.Boolean isHttpsInsecureConnection()
        Returns if the https connection is insecure or not.
        Returns:
        Secure https connection
      • setHttpsInsecureConnection

        public void setHttpsInsecureConnection​(java.lang.Boolean httpsInsecureConnection)
        Set if the https connection is insecure of not.
        Parameters:
        httpsInsecureConnection - Secure https connection.
      • request

        public final HttpResponse request()
        This method execute all the steps to do a http request. Creates the connection, sends the request package and reads the response, then this response is returned as a method response.
        Returns:
        Http response package.