| Modifier and Type | Method | Description |
|---|---|---|
JCurl |
build() |
Get an instance of JCurl with options configured by the
Builder(). |
JCurl.Builder |
connectTimeout(int milliseconds) |
How long to wait for a connection to the remote resource.
|
JCurl.Builder |
cookie(String name,
String value) |
Send a custom cookie with the request.
|
JCurl.Builder |
data(String payload) |
Send a POST request with DATA as request body.
|
JCurl.Builder |
expect(int expectedStatus) |
Add HTTP STATUS as an expected response code.
|
JCurl.Builder |
extract(String node) |
Iterate over a JSON array of objects returned by the call content and extract the value of NODE.
|
JCurl.Builder |
extract(String label,
String node) |
Extract NODE from a JSON object returned by the call and return as "LABEL=NODE".
|
JCurl.Builder |
extractCookies(boolean extract) |
Extract cookies returned by the call as KEY=VALUE pairs.
|
JCurl.Builder |
form(String name,
String value) |
Send a POST request with CONTENT as "key=value" pairs corresponding to a HTML form.
|
JCurl.Builder |
header(String name,
String value) |
Send a custom header with the request.
|
JCurl.Builder |
insecure(boolean disableChecks) |
Disable checks for an HTTPS request.
|
JCurl.Builder |
keystore(String store) |
The keystore containing the certificate to use for authentication.
|
JCurl.Builder |
method(JCurl.HttpMethod method) |
Set the HTTP type of the request.
|
JCurl.Builder |
nonProxyHosts(String hosts) |
Bypass the proxy (if defined) for the specified list of |-separated hosts.
|
JCurl.Builder |
proxy(String proxy) |
Proxy the request through the specified URL.
|
JCurl.Builder |
query(String name,
String value) |
Set request query parameters to be appended to the target URL as "name=value" pairs separated by "&";
|
JCurl.Builder |
readTimeout(int milliseconds) |
How long to wait for a response from the remote resource.
|
JCurl.Builder |
storepass(String pass) |
The keystore password.
|
JCurl.Builder |
storetype(String type) |
The keystore type.
|
JCurl.Builder |
trustAllCertificates(boolean disableChecks) |
Disable SSL certificate verification.
|
JCurl.Builder |
trustAllHostnames(boolean disableChecks) |
Disable SSL hostname verification.
|
JCurl.Builder |
trustpass(String pass) |
The truststore password.
|
JCurl.Builder |
truststore(String store) |
The truststore containing the server certificate.
|
JCurl.Builder |
trusttype(String type) |
The truststore type.
|
JCurl.Builder |
url(String url) |
The URL to connect to.
|
JCurl.Builder |
verbosity(int level) |
Output verbosity.
|
public JCurl.Builder method(JCurl.HttpMethod method)
JCurl.HttpMethod.GET.method - public JCurl.Builder data(String payload)
data("{\"message\": \"Hello world!\", \"format\": \"TEXT\"}".payload - public JCurl.Builder header(String name, String value)
header("Content-Type", "application/json").name - value - public JCurl.Builder form(String name, String value)
form("file", "@/my/test/file.txt"). name - value - public JCurl.Builder query(String name, String value)
name - value - public JCurl.Builder cookie(String name, String value)
name - value - public JCurl.Builder extractCookies(boolean extract)
extract - public JCurl.Builder extract(String label, String node)
extract("uid", "userSystemInfo.id") (returns \"uid=12345\").")label - node - public JCurl.Builder extract(String node)
extract(String, String) for more details.node - public JCurl.Builder expect(int expectedStatus)
expectedStatus - public JCurl.Builder verbosity(int level)
level - public JCurl.Builder keystore(String store)
store - public JCurl.Builder storetype(String type)
type - public JCurl.Builder storepass(String pass)
public JCurl.Builder truststore(String store)
store - public JCurl.Builder trusttype(String type)
type - public JCurl.Builder trustpass(String pass)
pass - public JCurl.Builder proxy(String proxy) throws MalformedURLException
proxy("https://my.proxy.com:8080")proxy - MalformedURLExceptionpublic JCurl.Builder nonProxyHosts(String hosts)
nonProxyHosts("my.host.org|*.otherhost.net").hosts - public JCurl.Builder insecure(boolean disableChecks)
trustAllHostnames(true)
and trustAllCertificates(true).disableChecks - public JCurl.Builder trustAllHostnames(boolean disableChecks)
disableChecks - public JCurl.Builder trustAllCertificates(boolean disableChecks)
disableChecks - public JCurl.Builder connectTimeout(int milliseconds)
milliseconds - public JCurl.Builder readTimeout(int milliseconds)
milliseconds - public JCurl.Builder url(String url)
url - Copyright © 2018 The Symphony Software Foundation. All rights reserved.