Class HttpClientHelper

java.lang.Object
com.helger.httpclient.HttpClientHelper

@Immutable public final class HttpClientHelper extends Object
Some utility methods for creating and handling Apache httpclient objects.
Author:
Philip Helger
  • Field Details

    • DEF_CONTENT_CHARSET

      public static final Charset DEF_CONTENT_CHARSET
    • DEF_PROTOCOL_CHARSET

      public static final Charset DEF_PROTOCOL_CHARSET
  • Method Details

    • createRequest

      @Nonnull public static org.apache.hc.client5.http.classic.methods.HttpUriRequestBase createRequest(@Nonnull com.helger.http.EHttpMethod eHTTPMethod, @Nonnull com.helger.url.ISimpleURL aSimpleURL)
    • createRequest

      @Nonnull public static org.apache.hc.client5.http.classic.methods.HttpUriRequestBase createRequest(@Nonnull com.helger.http.EHttpMethod eHTTPMethod, @Nonnull String sURI)
    • createContentType

      @Nullable public static org.apache.hc.core5.http.ContentType createContentType(@Nullable String sContentType, @Nullable Charset aCharset)
    • getCharset

      @Nonnull public static Charset getCharset(@Nonnull org.apache.hc.core5.http.ContentType aContentType)
    • getCharset

      @Nullable public static Charset getCharset(@Nonnull org.apache.hc.core5.http.ContentType aContentType, @Nullable Charset aDefault)
    • createHttpHost

      @Nullable public static org.apache.hc.core5.http.HttpHost createHttpHost(@Nullable Proxy aProxy)
    • createHttpHost

      @Nullable public static org.apache.hc.core5.http.HttpHost createHttpHost(@Nullable com.helger.network.proxy.config.HttpProxyConfig aProxyConfig)
    • createCredentials

      @Nullable public static org.apache.hc.client5.http.auth.Credentials createCredentials(@Nullable com.helger.network.proxy.config.HttpProxyConfig aProxyConfig)
    • createParameterEntity

      @Nullable public static org.apache.hc.core5.http.HttpEntity createParameterEntity(@Nullable Map<String,String> aMap, @Nonnull org.apache.hc.core5.http.ContentType aContentType)
    • createParameterEntity

      @Nullable public static org.apache.hc.core5.http.HttpEntity createParameterEntity(@Nullable Map<String,String> aMap, @Nonnull org.apache.hc.core5.http.ContentType aContentType, @Nonnull Charset aCharset)
    • getContentType

      @Nullable public static org.apache.hc.core5.http.ContentType getContentType(@Nullable org.apache.hc.core5.http.HttpEntity aEntity) throws UnsupportedCharsetException
      Throws:
      UnsupportedCharsetException
    • getContentTypeOrDefault

      @Nullable public static org.apache.hc.core5.http.ContentType getContentTypeOrDefault(@Nullable org.apache.hc.core5.http.HttpEntity aEntity) throws UnsupportedCharsetException
      Throws:
      UnsupportedCharsetException
    • getContentTypeOrDefault

      @Nullable public static org.apache.hc.core5.http.ContentType getContentTypeOrDefault(@Nullable org.apache.hc.core5.http.HttpEntity aEntity, @Nullable org.apache.hc.core5.http.ContentType aDefault) throws UnsupportedCharsetException
      Throws:
      UnsupportedCharsetException
    • entityToString

      @Nullable public static String entityToString(@Nonnull org.apache.hc.core5.http.HttpEntity aEntity, @Nonnull Charset aCharset) throws IOException
      Throws:
      IOException