Package io.ably.lib.http
Class HttpUtils
java.lang.Object
io.ably.lib.http.HttpUtils
HttpUtils: utility methods for Http operations
Internal
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic class
A RequestBody wrapping a byte arraystatic class
static class
A RequestBody wrapping a JSON-serialisable object -
Field Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptiondecodeParams
(String query) static Param[]
defaultAcceptHeaders
(boolean binary) static String
encodeParams
(String path, Param[] params) static String
encodeURIComponent
(String str) static Param[]
flattenParams
(Map<String, Param> map) static String
indexParams
(Param[] paramArray) static Param[]
mergeHeaders
(Param[] target, Param[] src) static URL
static HttpCore.RequestBody
requestBodyFromGson
(com.google.gson.JsonElement json, boolean useBinaryProtocol) static Param[]
toParamArray
(Map<String, List<String>> indexedParams) static String
Removes querystring from given url string and returns the url string without query string(s)
-
Field Details
-
mimeTypes
-
-
Constructor Details
-
HttpUtils
public HttpUtils()
-
-
Method Details
-
defaultAcceptHeaders
-
mergeHeaders
-
encodeParams
-
parseUrl
- Throws:
AblyException
-
urlWithQueryStringRemoved
Removes querystring from given url string and returns the url string without query string(s)- Parameters:
-
url
- Url string that needs querystring part removed - Returns:
- Url string with query string part removed, if existed in the first place
- Throws:
-
AblyException
- built from URISyntaxException if java.net.URI fails to build the URI given url
-
decodeParams
-
indexParams
-
mergeParams
-
flattenParams
-
toParamArray
-
getParam
-
encodeURIComponent
-
requestBodyFromGson
public static HttpCore.RequestBody requestBodyFromGson(com.google.gson.JsonElement json, boolean useBinaryProtocol)
-