public class RestClient
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
HTTPMETHOD_DELETE
HTTP DELETE.
|
static java.lang.String |
HTTPMETHOD_GET
HTTP GET.
|
static java.lang.String |
HTTPMETHOD_HEAD
HTTP GET.
|
static java.lang.String |
HTTPMETHOD_POST
HTTP POST.
|
static java.lang.String |
HTTPMETHOD_PUT
HTTP PUT.
|
Constructor and Description |
---|
RestClient(java.lang.String uri) |
RestClient(java.lang.String[] args) |
Modifier and Type | Method and Description |
---|---|
com.ibm.json.java.JSONArtifact |
bytesToJSON(byte[] data) |
static java.lang.String |
encode(java.lang.String userName,
java.lang.String password)
encode the username and password with BASE64Encoder
|
byte[] |
invoke() |
byte[] |
invoke(byte[] data) |
com.ibm.json.java.JSONArtifact |
invoke(com.ibm.json.java.JSONArtifact jo) |
com.ibm.json.java.JSONArtifact |
invokeJson() |
RestClient |
withApiKey(java.lang.String apikey) |
RestClient |
withHeaders(java.util.Map<java.lang.String,java.lang.String> headers) |
RestClient |
withMethod(java.lang.String httpMethod) |
RestClient |
withQueryParams(java.util.Map<java.lang.String,java.lang.String> qparams) |
public static final java.lang.String HTTPMETHOD_GET
public static final java.lang.String HTTPMETHOD_HEAD
public static final java.lang.String HTTPMETHOD_POST
public static final java.lang.String HTTPMETHOD_PUT
public static final java.lang.String HTTPMETHOD_DELETE
public RestClient(java.lang.String[] args)
public RestClient(java.lang.String uri)
public RestClient withQueryParams(java.util.Map<java.lang.String,java.lang.String> qparams)
public RestClient withHeaders(java.util.Map<java.lang.String,java.lang.String> headers)
public RestClient withMethod(java.lang.String httpMethod)
public RestClient withApiKey(java.lang.String apikey)
public com.ibm.json.java.JSONArtifact invokeJson() throws java.lang.Exception
java.lang.Exception
public com.ibm.json.java.JSONArtifact bytesToJSON(byte[] data) throws java.lang.Exception
java.lang.Exception
public byte[] invoke() throws java.lang.Exception
java.lang.Exception
public com.ibm.json.java.JSONArtifact invoke(com.ibm.json.java.JSONArtifact jo) throws java.lang.Exception
java.lang.Exception
public byte[] invoke(byte[] data) throws java.lang.Exception
java.lang.Exception
public static java.lang.String encode(java.lang.String userName, java.lang.String password) throws java.lang.Exception
userName
- - a Stringpassword
- - a Stringjava.lang.Exception