public class ManUrlExt
extends java.lang.Object
| Constructor and Description |
|---|
ManUrlExt() |
| Modifier and Type | Method and Description |
|---|---|
static java.lang.String |
encode(java.lang.String urlPart)
Convenience method to encode a URL string and not have to handle the
UnsupportedEncodingException.
|
static byte[] |
getBinaryContent(java.net.URL thiz) |
static java.lang.Object |
getCsvContent(java.net.URL thiz) |
static java.lang.Object |
getJsonContent(java.net.URL thiz) |
static java.lang.String |
getTextContent(java.net.URL thiz) |
static java.lang.Object |
getXmlContent(java.net.URL thiz) |
static java.lang.Object |
getYamlContent(java.net.URL thiz) |
static java.net.URL |
makeUrl(java.lang.String url,
java.lang.Object jsonValue)
Make a JSON-compatible URL with the arguments from the
jsonValue. |
static java.lang.Object |
sendCsvRequest(java.net.URL url,
java.net.Proxy proxy,
java.lang.String httpMethod,
java.lang.Object jsonValue,
java.util.Map<java.lang.String,java.lang.String> headers,
int timeout) |
static java.lang.Object |
sendCsvRequest(java.net.URL url,
java.lang.String httpMethod,
java.lang.Object jsonValue,
java.util.Map<java.lang.String,java.lang.String> headers,
int timeout)
Use HTTP GET, POST, PUT, or PATCH to send JSON bindings to a URL with a CSV response.
|
static java.lang.Object |
sendJsonRequest(java.net.URL url,
java.net.Proxy proxy,
java.lang.String httpMethod,
java.lang.Object jsonValue,
java.util.Map<java.lang.String,java.lang.String> headers,
int timeout) |
static java.lang.Object |
sendJsonRequest(java.net.URL url,
java.lang.String httpMethod,
java.lang.Object jsonValue)
Use HTTP GET, POST, PUT, or PATCH to send JSON bindings to a URL with a JSON response.
|
static java.lang.Object |
sendJsonRequest(java.net.URL url,
java.lang.String httpMethod,
java.lang.Object jsonValue,
java.util.Map<java.lang.String,java.lang.String> headers,
int timeout) |
static java.lang.String |
sendPlainTextRequest(java.net.URL url,
java.net.Proxy proxy,
java.lang.String httpMethod,
java.lang.Object jsonValue,
java.util.Map<java.lang.String,java.lang.String> headers,
int timeout) |
static java.lang.String |
sendPlainTextRequest(java.net.URL url,
java.lang.String httpMethod,
java.lang.Object jsonValue)
Use HTTP GET, POST, PUT, or PATCH to send JSON bindings to a URL with a plain text response.
|
static java.lang.String |
sendPlainTextRequest(java.net.URL url,
java.lang.String httpMethod,
java.lang.Object jsonValue,
java.util.Map<java.lang.String,java.lang.String> headers,
int timeout) |
static java.lang.Object |
sendXmlRequest(java.net.URL url,
java.net.Proxy proxy,
java.lang.String httpMethod,
java.lang.Object jsonValue,
java.util.Map<java.lang.String,java.lang.String> headers,
int timeout) |
static java.lang.Object |
sendXmlRequest(java.net.URL url,
java.lang.String httpMethod,
java.lang.Object jsonValue,
java.util.Map<java.lang.String,java.lang.String> headers,
int timeout)
Use HTTP GET, POST, PUT, or PATCH to send JSON bindings to a URL with a XML response.
|
static java.lang.Object |
sendYamlRequest(java.net.URL url,
java.net.Proxy proxy,
java.lang.String httpMethod,
java.lang.Object jsonValue,
java.util.Map<java.lang.String,java.lang.String> headers,
int timeout) |
static java.lang.Object |
sendYamlRequest(java.net.URL url,
java.lang.String httpMethod,
java.lang.Object jsonValue)
Use HTTP GET, POST, PUT, or PATCH to send JSON bindings to a URL with a YAML response.
|
static java.lang.Object |
sendYamlRequest(java.net.URL url,
java.lang.String httpMethod,
java.lang.Object jsonValue,
java.util.Map<java.lang.String,java.lang.String> headers,
int timeout) |
public static java.net.URL makeUrl(java.lang.String url,
java.lang.Object jsonValue)
jsonValue. Encodes
the arguments in UTF-8 and appends them to the list using standard URL query delimiters.
If an individual argument is a Bindings or a List, it is transformed to JSON.
Otherwise, the argument is coerced to a String and URL encoded.public static java.lang.String encode(java.lang.String urlPart)
public static java.lang.Object sendJsonRequest(java.net.URL url,
java.lang.String httpMethod,
java.lang.Object jsonValue)
httpMethod - The HTTP method to use: "GET", "POST", "PUT", or "PATCH"jsonValue - A JSON value to send (primitive/boxed type, String, List of JSON values, or Bindings of String/JSON value)sendRequest(URL, String, Object, Map, int)public static java.lang.Object sendJsonRequest(java.net.URL url,
java.lang.String httpMethod,
java.lang.Object jsonValue,
java.util.Map<java.lang.String,java.lang.String> headers,
int timeout)
public static java.lang.Object sendJsonRequest(java.net.URL url,
java.net.Proxy proxy,
java.lang.String httpMethod,
java.lang.Object jsonValue,
java.util.Map<java.lang.String,java.lang.String> headers,
int timeout)
public static java.lang.Object sendYamlRequest(java.net.URL url,
java.lang.String httpMethod,
java.lang.Object jsonValue)
httpMethod - The HTTP method to use: "GET", "POST", "PUT", or "PATCH"jsonValue - A JSON value to send (primitive/boxed type, String, List of JSON values, or Bindings of String/JSON value)sendRequest(URL, String, Object, Map, int)public static java.lang.Object sendYamlRequest(java.net.URL url,
java.lang.String httpMethod,
java.lang.Object jsonValue,
java.util.Map<java.lang.String,java.lang.String> headers,
int timeout)
public static java.lang.Object sendYamlRequest(java.net.URL url,
java.net.Proxy proxy,
java.lang.String httpMethod,
java.lang.Object jsonValue,
java.util.Map<java.lang.String,java.lang.String> headers,
int timeout)
public static java.lang.Object sendXmlRequest(java.net.URL url,
java.lang.String httpMethod,
java.lang.Object jsonValue,
java.util.Map<java.lang.String,java.lang.String> headers,
int timeout)
httpMethod - The HTTP method to use: "GET", "POST", "PUT", or "PATCH"jsonValue - A JSON value to send (primitive/boxed type, String, List of JSON values, or Bindings of String/JSON value)sendRequest(URL, String, Object, Map, int)public static java.lang.Object sendXmlRequest(java.net.URL url,
java.net.Proxy proxy,
java.lang.String httpMethod,
java.lang.Object jsonValue,
java.util.Map<java.lang.String,java.lang.String> headers,
int timeout)
public static java.lang.Object sendCsvRequest(java.net.URL url,
java.lang.String httpMethod,
java.lang.Object jsonValue,
java.util.Map<java.lang.String,java.lang.String> headers,
int timeout)
httpMethod - The HTTP method to use: "GET", "POST", "PUT", or "PATCH"jsonValue - A JSON value to send (primitive/boxed type, String, List of JSON values, or Bindings of String/JSON value)sendRequest(URL, String, Object, Map, int)public static java.lang.Object sendCsvRequest(java.net.URL url,
java.net.Proxy proxy,
java.lang.String httpMethod,
java.lang.Object jsonValue,
java.util.Map<java.lang.String,java.lang.String> headers,
int timeout)
public static java.lang.String sendPlainTextRequest(java.net.URL url,
java.lang.String httpMethod,
java.lang.Object jsonValue)
httpMethod - The HTTP method to use: "GET", "POST", "PUT", or "PATCH"jsonValue - A JSON value to send (primitive/boxed type, String, List of JSON values, or Bindings of String/JSON value)sendRequest(URL, String, Object, Map, int)public static java.lang.String sendPlainTextRequest(java.net.URL url,
java.lang.String httpMethod,
java.lang.Object jsonValue,
java.util.Map<java.lang.String,java.lang.String> headers,
int timeout)
public static java.lang.String sendPlainTextRequest(java.net.URL url,
java.net.Proxy proxy,
java.lang.String httpMethod,
java.lang.Object jsonValue,
java.util.Map<java.lang.String,java.lang.String> headers,
int timeout)
public static java.lang.String getTextContent(java.net.URL thiz)
public static byte[] getBinaryContent(java.net.URL thiz)
public static java.lang.Object getJsonContent(java.net.URL thiz)
RuntimeException results if the
content is not a JSON document.public static java.lang.Object getYamlContent(java.net.URL thiz)
RuntimeException results if the
content is not a YAML document.public static java.lang.Object getXmlContent(java.net.URL thiz)
RuntimeException results if the
content is not a XML document.public static java.lang.Object getCsvContent(java.net.URL thiz)
RuntimeException results if the
content is not a CSV document.Copyright © 2023. All rights reserved.