public class Endpoint
extends java.lang.Object
Endpoint class are called indirectly through higher level APIs.| Constructor and Description |
|---|
Endpoint(java.lang.String urlBase) |
Endpoint(java.lang.String urlBase,
java.lang.String proxyAddr,
int proxyPort)
Makes an
HTTP proxied endpoint. |
Endpoint(java.lang.String urlBase,
java.lang.String proxyAddr,
int proxyPort,
java.net.Proxy.Type proxyType)
Makes a proxied endpoint at the specified
urlBase. |
Endpoint(java.lang.String urlBase,
java.lang.String proxyAddr,
java.net.Proxy.Type proxyType)
Makes an proxied endpoint on port
8080. |
| Modifier and Type | Method and Description |
|---|---|
java.net.URLConnection |
openConnection()
Opens a connection on this endpoint's URL and Proxy.
|
java.lang.Object |
sendCsvRequest(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 the endpoint with a CSV response.
|
java.lang.Object |
sendJsonRequest(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 the endpoint with a JSON response.
|
java.lang.Object |
sendPlainTextRequest(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 plain text response.
|
java.lang.Object |
sendXmlRequest(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 an XML response.
|
java.lang.Object |
sendYamlRequest(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 YAML response.
|
Endpoint |
withUrlSuffix(java.lang.String urlSuffix)
Creates a new
Endpoint with a base URL consisting of this endpoint's base URL + urlSuffix. |
public Endpoint(java.lang.String urlBase)
urlBase - The base URL for the endpoint. Can have name=value arguments.public Endpoint(java.lang.String urlBase,
java.lang.String proxyAddr,
int proxyPort)
HTTP proxied endpoint.urlBase - The base URL for the endpoint. Can have name=value arguments.proxyAddr - The address of the proxy server, such as "http://my.proxyserver.com".proxyPort - The port number of the proxy server, typically 8080.public Endpoint(java.lang.String urlBase,
java.lang.String proxyAddr,
java.net.Proxy.Type proxyType)
8080.urlBase - The base URL for the endpoint. Can have name=value arguments.proxyAddr - The address of the proxy server, such as "http://my.proxyserver.com".proxyType - The proxy type: HTTP or SOCKS. Use Endpoint(String) if there is no
proxy server.public Endpoint(java.lang.String urlBase,
java.lang.String proxyAddr,
int proxyPort,
java.net.Proxy.Type proxyType)
urlBase.urlBase - The base URL for the endpoint. Can have name=value arguments.proxyAddr - The address of the proxy server, such as "http://my.proxyserver.com".proxyPort - The port number of the proxy server, typically 8080.proxyType - The proxy type: HTTP or SOCKS. Use Endpoint(String) if there is no
proxy server.public Endpoint withUrlSuffix(java.lang.String urlSuffix)
Endpoint with a base URL consisting of this endpoint's base URL + urlSuffix.urlSuffix - Use the suffix to make a new url consisting of this endpoint's base URL + urlSuffix.Endpoint with a base URL consisting of this endpoint's base URL + urlSuffix.public java.net.URLConnection openConnection()
throws java.io.IOException
java.io.IOExceptionURL.openConnection(Proxy)public java.lang.Object sendCsvRequest(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)public java.lang.Object sendJsonRequest(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)public java.lang.Object sendPlainTextRequest(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)public java.lang.Object sendXmlRequest(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)public java.lang.Object sendYamlRequest(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)Copyright © 2024. All rights reserved.