Package com.helger.httpclient
Class HttpClientHelper
java.lang.Object
com.helger.httpclient.HttpClientHelper
Some utility methods for creating and handling Apache httpclient objects.
- Author:
- Philip Helger
-
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptionstatic org.apache.hc.core5.http.ContentTypecreateContentType(String sContentType, Charset aCharset) static org.apache.hc.client5.http.auth.CredentialscreateCredentials(com.helger.network.proxy.config.HttpProxyConfig aProxyConfig) static org.apache.hc.core5.http.HttpHostcreateHttpHost(com.helger.network.proxy.config.HttpProxyConfig aProxyConfig) static org.apache.hc.core5.http.HttpHostcreateHttpHost(Proxy aProxy) static org.apache.hc.core5.http.HttpEntitycreateParameterEntity(Map<String, String> aMap, org.apache.hc.core5.http.ContentType aContentType) static org.apache.hc.core5.http.HttpEntitycreateParameterEntity(Map<String, String> aMap, org.apache.hc.core5.http.ContentType aContentType, Charset aCharset) static org.apache.hc.client5.http.classic.methods.HttpUriRequestBasecreateRequest(com.helger.http.EHttpMethod eHTTPMethod, com.helger.url.ISimpleURL aSimpleURL) static org.apache.hc.client5.http.classic.methods.HttpUriRequestBasecreateRequest(com.helger.http.EHttpMethod eHTTPMethod, String sURI) static StringentityToString(org.apache.hc.core5.http.HttpEntity aEntity, Charset aCharset) static CharsetgetCharset(org.apache.hc.core5.http.ContentType aContentType) static CharsetgetCharset(org.apache.hc.core5.http.ContentType aContentType, Charset aDefault) static org.apache.hc.core5.http.ContentTypegetContentType(org.apache.hc.core5.http.HttpEntity aEntity) static org.apache.hc.core5.http.ContentTypegetContentTypeOrDefault(org.apache.hc.core5.http.HttpEntity aEntity) static org.apache.hc.core5.http.ContentTypegetContentTypeOrDefault(org.apache.hc.core5.http.HttpEntity aEntity, org.apache.hc.core5.http.ContentType aDefault)
-
Field Details
-
DEF_CONTENT_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
-
getCharset
@Nonnull public static Charset getCharset(@Nonnull org.apache.hc.core5.http.ContentType aContentType) -
getCharset
-
createHttpHost
-
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
-
createParameterEntity
-
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
-