public class JSONClient extends Object
| Modifier and Type | Field and Description |
|---|---|
protected String |
baseUrl |
protected String |
password |
protected SSLSocketFactory |
trustAllSslSocketFactory |
protected String |
username |
| Constructor and Description |
|---|
JSONClient(String baseUrl,
String username,
String password) |
| Modifier and Type | Method and Description |
|---|---|
protected net.sf.json.JSONObject |
doDelete(String restPath) |
protected net.sf.json.JSONObject |
doGet(String restPath) |
protected net.sf.json.JSONObject |
doGet(String restPath,
boolean returnsArray) |
protected net.sf.json.JSONObject |
doGet(String restPath,
String parameter,
boolean returnsArray)
Set returnsArray to true if the API method returns a limit of items.
|
protected net.sf.json.JSONObject |
doPost(String restPath,
net.sf.json.JSONObject payload) |
protected static SSLSocketFactory |
makeTrustAllSslSocketFactory() |
protected String baseUrl
protected String username
protected String password
protected SSLSocketFactory trustAllSslSocketFactory
protected net.sf.json.JSONObject doGet(String restPath, boolean returnsArray) throws IOException
IOExceptionprotected net.sf.json.JSONObject doGet(String restPath) throws IOException
IOExceptionprotected net.sf.json.JSONObject doGet(String restPath, String parameter, boolean returnsArray) throws IOException
restPath - api pathparameter - single string in the format of key=value&key=value to be appended after offset and limit parametersreturnsArray - IOExceptionprotected net.sf.json.JSONObject doPost(String restPath, net.sf.json.JSONObject payload) throws IOException
IOExceptionprotected net.sf.json.JSONObject doDelete(String restPath) throws IOException
IOExceptionprotected static SSLSocketFactory makeTrustAllSslSocketFactory() throws GeneralSecurityException, IOException
GeneralSecurityExceptionIOExceptionCopyright © 2016–2019 Parasoft. All rights reserved.