|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.baidubce.util.HttpUtils
public class HttpUtils
Constructor Summary | |
---|---|
HttpUtils()
|
Method Summary | |
---|---|
static URI |
appendUri(URI baseUri,
String... pathComponents)
Append the given path to the given baseUri. |
static String |
generateHostHeader(URI uri)
Returns a host header according to the specified URI. |
static String |
getCanonicalQueryString(Map<String,String> parameters,
boolean forSignature)
|
static boolean |
isUsingNonDefaultPort(URI uri)
Returns true if the specified URI is using a non-standard port (i.e. |
static String |
normalize(String value)
Normalize a string for use in BCE web service APIs. |
static String |
normalizePath(String path)
Normalize a string for use in url path. |
static void |
printRequest(org.apache.http.client.methods.HttpRequestBase request)
|
static void |
printResponse(org.apache.http.client.methods.CloseableHttpResponse response)
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public HttpUtils()
Method Detail |
---|
public static String normalizePath(String path)
Bos object key can contain arbitrary characters, which may result double slash in the url path. Apache http client will replace "//" in the path with a single '/', which makes the object key incorrect. Thus we replace "//" with "/%2F" here.
path
- the path string to normalize.
normalize(String)
public static String normalize(String value)
All letters used in the percent-encoding are in uppercase.
value
- the string to normalize.
public static String generateHostHeader(URI uri)
uri
- the URI
public static boolean isUsingNonDefaultPort(URI uri)
uri
- the URI
public static String getCanonicalQueryString(Map<String,String> parameters, boolean forSignature)
public static URI appendUri(URI baseUri, String... pathComponents)
This method will encode the given path but not the given baseUri.
baseUri
- pathComponents
- public static void printRequest(org.apache.http.client.methods.HttpRequestBase request)
public static void printResponse(org.apache.http.client.methods.CloseableHttpResponse response)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |