public class MailjetRequest extends Object
| Constructor and Description |
|---|
MailjetRequest(Resource res)
Make a Mailjet request with a single resource.
|
MailjetRequest(Resource res,
long id)
In case of a simple view.
|
MailjetRequest(Resource res,
long id,
long actionid)
Build a Request with an actionID
|
MailjetRequest(Resource res,
String id)
In case of a simple view.
|
| Modifier and Type | Method and Description |
|---|---|
MailjetRequest |
append(String key,
Object value)
Append a value to the body[key]
|
String |
buildUrl()
Build the call URL with query string parameters
|
MailjetRequest |
filter(String key,
int value)
Add a String/int filter to the _filters hash
|
MailjetRequest |
filter(String key,
String value)
Add a String-String filter to the the _filters hash
|
String |
getBody()
Body getter
|
org.json.JSONObject |
getBodyJSON()
Body JSON getter
|
String |
getContentType()
Returns the appropriate Content-Type according to the resource/action
|
MailjetRequest |
property(String key,
Object value)
Add a property to the body JSONObject
|
String |
queryString()
Build a query string using the _filters hash
|
MailjetRequest |
setBody(HashMap<String,Object> json)
Use an HashMap to build the body
|
MailjetRequest |
setBody(org.json.JSONObject json)
Pass a JSONObject formatted json as the request body
|
MailjetRequest |
setBody(String json)
Pass a String formatted json as the request body
|
MailjetRequest |
setData(String path) |
String |
toString() |
public MailjetRequest(Resource res)
res - public MailjetRequest(Resource res, long id)
res - id - public MailjetRequest(Resource res, String id)
res - id - public MailjetRequest(Resource res, long id, long actionid)
res - the resource objectid - the resource IDactionid - the resource action IDpublic MailjetRequest setData(String path) throws IOException
IOExceptionpublic MailjetRequest setBody(String json)
json - public MailjetRequest setBody(org.json.JSONObject json)
json - public MailjetRequest setBody(HashMap<String,Object> json)
json - public String getBody()
public org.json.JSONObject getBodyJSON()
public String getContentType()
public String buildUrl() throws MalformedURLException, UnsupportedEncodingException
MalformedURLExceptionUnsupportedEncodingExceptionpublic MailjetRequest append(String key, Object value)
key - the keyvalue - the value to be pushedpublic MailjetRequest filter(String key, String value)
key - value - public MailjetRequest filter(String key, int value)
key - value - public String queryString() throws UnsupportedEncodingException
UnsupportedEncodingExceptionpublic MailjetRequest property(String key, Object value)
key - value - Copyright © 2017. All rights reserved.