public class AsyncHttpProviderUtils extends Object
AsyncHttpProvider
common utilities.
The cookies's handling code is from the Netty framework.Modifier and Type | Field and Description |
---|---|
static String |
DEFAULT_CHARSET |
Constructor and Description |
---|
AsyncHttpProviderUtils() |
public static final String DEFAULT_CHARSET
public static final void validateSupportedScheme(URI uri)
public static final String contentToString(List<HttpResponseBodyPart> bodyParts, String charset) throws UnsupportedEncodingException
UnsupportedEncodingException
public static final byte[] contentToByte(List<HttpResponseBodyPart> bodyParts) throws UnsupportedEncodingException
UnsupportedEncodingException
public static final InputStream contentToInputStream(List<HttpResponseBodyPart> bodyParts) throws UnsupportedEncodingException
UnsupportedEncodingException
public static final int getPort(URI uri)
public static final MultipartRequestEntity createMultipartRequestEntity(List<Part> params, FluentCaseInsensitiveStringsMap requestHeaders) throws FileNotFoundException
params
- requestHeaders
- FileNotFoundException
public static final byte[] readFully(InputStream in, int[] lengthWrapper) throws IOException
IOException
public static String constructUserAgent(Class<? extends AsyncHttpProvider> httpProvider)
public static String keepAliveHeaderValue(AsyncHttpClientConfig config)
public static int requestTimeout(AsyncHttpClientConfig config, Request request)
Copyright © 2014. All Rights Reserved.