类 HttpUtils
java.lang.Object
com.baidu.mochow.util.HttpUtils
-
构造器概要
构造器 -
方法概要
修饰符和类型方法说明static URIAppend the given path to the given baseUri.static StringgenerateHostHeader(URI uri) Returns a host header according to the specified URI.static StringgetCanonicalQueryString(Map<String, String> parameters, boolean forSignature) static booleanisUsingNonDefaultPort(URI uri) Returns true if the specified URI is using a non-standard port (i.e. any port other than 80 for HTTP URIs or any port other than 443 for HTTPS URIs).static Stringstatic StringnormalizePath(String path) static voidprintRequest(org.apache.http.client.methods.HttpRequestBase request)
-
构造器详细资料
-
HttpUtils
public HttpUtils()
-
-
方法详细资料
-
normalizePath
- 参数:
path- the path string to normalize.- 返回:
- the normalized path string.
- 另请参阅:
-
normalize
- 参数:
value- the string to normalize.- 返回:
- the normalized string.
-
generateHostHeader
Returns a host header according to the specified URI. The host header is generated with the same logic used by apache http client, that is, append the port to hostname only if it is not the default port.- 参数:
uri- the URI- 返回:
- a host header according to the specified URI.
-
isUsingNonDefaultPort
Returns true if the specified URI is using a non-standard port (i.e. any port other than 80 for HTTP URIs or any port other than 443 for HTTPS URIs).- 参数:
uri- the URI- 返回:
- True if the specified URI is using a non-standard port, otherwise false.
-
getCanonicalQueryString
-
appendUri
Append the given path to the given baseUri. This method will encode the given path but not the given baseUri. -
printRequest
public static void printRequest(org.apache.http.client.methods.HttpRequestBase request)
-