Package com.ning.http.util
Class AsyncHttpProviderUtils
java.lang.Object
com.ning.http.util.AsyncHttpProviderUtils
AsyncHttpProvider common utilities.
The cookies's handling code is from the Netty framework.-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic StringconnectionHeader(boolean allowConnectionPooling, boolean http11) static final byte[]contentToByte(List<HttpResponseBodyPart> bodyParts) static final InputStreamcontentToInputStream(List<HttpResponseBodyPart> bodyParts) static final StringcontentToString(List<HttpResponseBodyPart> bodyParts, Charset charset) static booleanfollowRedirect(AsyncHttpClientConfig config, Request request) static final StringgetAuthority(Uri uri) static final StringgetBaseUrl(Uri uri) static final intgetDefaultPort(Uri uri) static final StringgetNonEmptyPath(Uri uri) Convenient for HTTP layer when targeting server rootstatic Stringstatic final intgetSchemeDefaultPort(String scheme) static final booleanisSameHostAndProtocol(Uri uri1, Uri uri2) static booleanstatic booleanstatic booleanisWebSocket(String scheme) static StringparseCharset(String contentType) static final byte[]readFully(InputStream in, int[] lengthWrapper) static intrequestTimeout(AsyncHttpClientConfig config, Request request) static ByteBufferurlEncodeFormParams(List<Param> params, Charset charset) static StringBuilderurlEncodeFormParams0(List<Param> params) static booleanuseProxyConnect(Uri uri)
-
Field Details
-
REMOTELY_CLOSED_EXCEPTION
-
DEFAULT_CHARSET
-
HTTP
- See Also:
-
HTTPS
- See Also:
-
WEBSOCKET
- See Also:
-
WEBSOCKET_SSL
- See Also:
-
-
Constructor Details
-
AsyncHttpProviderUtils
public AsyncHttpProviderUtils()
-
-
Method Details
-
getBaseUrl
-
getAuthority
-
contentToString
public static final String contentToString(List<HttpResponseBodyPart> bodyParts, Charset charset) throws UnsupportedEncodingException - Throws:
UnsupportedEncodingException
-
contentToByte
public static final byte[] contentToByte(List<HttpResponseBodyPart> bodyParts) throws UnsupportedEncodingException - Throws:
UnsupportedEncodingException
-
contentToInputStream
public static final InputStream contentToInputStream(List<HttpResponseBodyPart> bodyParts) throws UnsupportedEncodingException - Throws:
UnsupportedEncodingException
-
isSameHostAndProtocol
-
getSchemeDefaultPort
-
getDefaultPort
-
getNonEmptyPath
Convenient for HTTP layer when targeting server root- Returns:
- the raw path or "/" if it's null
-
readFully
- Throws:
IOException
-
parseCharset
-
connectionHeader
-
requestTimeout
-
followRedirect
-
urlEncodeFormParams0
-
urlEncodeFormParams
-
getNTLM
-
isWebSocket
-
isSecure
-
isSecure
-
useProxyConnect
-