public class ManUrlExt extends Object
| Constructor and Description |
|---|
ManUrlExt() |
| Modifier and Type | Method and Description |
|---|---|
static String |
encode(String urlPart)
Convenience method to encode a URL string and not have to handle the
UnsupportedEncodingException.
|
static byte[] |
getBinaryContent(URL thiz) |
static Bindings |
getJsonContent(URL thiz) |
static String |
getTextContent(URL thiz) |
static URL |
makeUrl(String url,
Bindings arguments)
Make a JSON-compatible URL with the arguments from the Bindings.
|
static Bindings |
postForJsonContent(URL url,
Bindings bindings)
Use http POST to pass JSON bindings to this URL and get the full content as a JSON object.
|
static String |
postForTextContent(URL url,
Bindings bindings)
Use http POST to pass JSON bindings to this URL and get back the full content as a String.
|
public static URL makeUrl(String url, Bindings arguments)
public static String encode(String urlPart)
public static String postForTextContent(URL url, Bindings bindings)
If an argument is a javax.script.Bindings or a List, it is transformed to JSON. Otherwise, the argument is coerced to a String. All arguments are URL encoded.
postForJsonContent(URL, Bindings)public static Bindings postForJsonContent(URL url, Bindings bindings)
If an argument is a javax.script.Bindings or a List, it is transformed to JSON. Otherwise, the argument is coerced to a String. All arguments are URL encoded.
postForTextContent(URL, Bindings)public static String getTextContent(URL thiz)
public static byte[] getBinaryContent(URL thiz)
public static Bindings getJsonContent(URL thiz)
Json.fromJson(String)Copyright © 2018. All rights reserved.