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 Bindings |
getYamlContent(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 arguments)
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 arguments)
Use HTTP POST to pass JSON bindings to
this URL and get back the full content as a String.
|
static Bindings |
postForYamlContent(URL url,
Bindings arguments)
Use HTTP POST to pass YAML bindings to
this URL and get the full content as a YAML object.
|
public static String encode(String urlPart)
public static String postForTextContent(URL url, Bindings arguments)
arguments - A mapping of argument name to value, using JSON Schema as the formatpostForJsonContent(URL, Bindings)public static Bindings postForJsonContent(URL url, Bindings arguments)
arguments - A mapping of argument name to value, using JSON Schema as the formatpostForTextContent(URL, Bindings)public static Bindings postForYamlContent(URL url, Bindings arguments)
arguments - A mapping of argument name to value, using JSON Schema as the formatpostForTextContent(URL, Bindings)public static String getTextContent(URL thiz)
public static byte[] getBinaryContent(URL thiz)
public static Bindings getJsonContent(URL thiz)
RuntimeException results if the
content is not a JSON document.Json.fromJson(String)public static Bindings getYamlContent(URL thiz)
RuntimeException results if the
content is not a YAML document.Yaml.fromYaml(String)Copyright © 2019. All rights reserved.