T - public class Executor<T> extends Object
| Constructor and Description |
|---|
Executor(String url,
String operation,
String query,
Bindings variables) |
| Modifier and Type | Method and Description |
|---|---|
T |
get() |
T |
get(Requester.Format format)
Make an HTTP GET request to
url. |
T |
post() |
T |
post(Requester.Format format)
Make an HTTP POST request to
url. |
Executor<T> |
withAuthorization(String tokenType,
String accessToken) |
Executor<T> |
withBasicAuthorization(String username,
String password)
Set the Basic Authorization header using the provided
username and password |
Executor<T> |
withBearerAuthorization(String accessToken)
Set the Bearer Authorization header using the provided
accessToken. |
Executor<T> |
withHeader(String name,
String value)
Set an HTTP request header
name : value pair
See HTTP header fields |
Executor<T> |
withTimeout(int timeout)
The connection timeout setting in milliseconds.
|
public Executor<T> withHeader(String name, String value)
name : value pair
See HTTP header fieldspublic Executor<T> withBasicAuthorization(String username, String password)
username and passwordpublic Executor<T> withBearerAuthorization(String accessToken)
accessToken.
For instance, if using OAuth, accessToken is the token response from:
curl -d "grant_type=password&client_id=[...]&client_secret=[...]&username=[...]&password=[...]"
https://[domain]/[oauth-service]
public Executor<T> withTimeout(int timeout)
public T post()
public T post(Requester.Format format)
url. The payload, if non-null, is sent as JSON encoded
text in the request's message body.format - The expected format of the response. One of: Json, Yaml, or Plainformat specified encoded response (primitive/boxed type, String, List of JSON values, or Bindings of String/JSON value)public T get()
public T get(Requester.Format format)
url. The payload, if non-null, is sent as JSON encoded
text in the request's message body.format - The expected format of the response. One of: Json, Yaml, or Plainformat specified encoded response (primitive/boxed type, String, List of JSON values, or Bindings of String/JSON value)Copyright © 2020. All rights reserved.