public class Request
extends java.lang.Object
This class is NOT part of the public API.
| Modifier and Type | Class and Description |
|---|---|
static class |
Request.CantConnectException
Thrown when the request failed because the requested could not connect to the server.
|
| Modifier and Type | Field and Description |
|---|---|
static java.lang.String |
CHARSET |
| Constructor and Description |
|---|
Request(Method method,
java.lang.String address)
Creates a new request to the server, and starts to execute it.
|
| Modifier and Type | Method and Description |
|---|---|
Request |
addJson(com.eclipsesource.json.JsonValue params)
Adds JSON parameters to this request.
|
Request |
addToken(java.lang.String token)
Makes the request authenticated by adding the token of the user.
|
com.eclipsesource.json.JsonValue |
get()
Accesses the JSON response from the server.
|
public static final java.lang.String CHARSET
public Request(Method method, java.lang.String address) throws Request.CantConnectException
method - the HTTP method required by the APIaddress - the address you'd like to access (see the API documentation)Request.CantConnectException - if the connection to the server failspublic Request addToken(java.lang.String token)
token - the tokenpublic Request addJson(com.eclipsesource.json.JsonValue params) throws Request.CantConnectException
params - the parametersRequest.CantConnectException - if the lib cannot connect to the serverpublic com.eclipsesource.json.JsonValue get()
throws IssueInTransferException
IssueInTransferException - if there is problem with the connection or the data