public class PcHttpUtils
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
private static org.slf4j.Logger |
logger
The logger.
|
Constructor and Description |
---|
PcHttpUtils() |
Modifier and Type | Method and Description |
---|---|
static void |
addHeaders(com.ning.http.client.AsyncHttpClient.BoundRequestBuilder builder,
java.util.Map<java.lang.String,java.lang.String> headerMap)
Adds the headers.
|
static boolean |
isUrlValid(java.lang.String url)
currently not to use MalformedURLException or MalformedURLException as
our logic includes add HTTP :// etc Assuming not null .
|
static void |
replaceHttpHeaderMapNodeSpecific(java.util.Map<java.lang.String,java.lang.String> httpHeaderMap,
java.util.Map<java.lang.String,java.lang.String> requestParameters)
!!!! ASSUMPTION: all VAR exists in HTTP Header must of type:
APIVARREPLACE_NAME_PREFIX_HTTP_HEADER
20140310 This may be costly (O(n^2)) of the updated related # of headers;
# of parameters in the requests.
|
public static boolean isUrlValid(java.lang.String url)
url
- the urlpublic static void replaceHttpHeaderMapNodeSpecific(java.util.Map<java.lang.String,java.lang.String> httpHeaderMap, java.util.Map<java.lang.String,java.lang.String> requestParameters)
httpHeaderMap
- the http header maprequestParameters
- the request parameterspublic static void addHeaders(com.ning.http.client.AsyncHttpClient.BoundRequestBuilder builder, java.util.Map<java.lang.String,java.lang.String> headerMap)
builder
- the builderheaderMap
- the header map