public interface SendGridAPI
| Modifier and Type | Method and Description |
|---|---|
Map<String,String> |
addRequestHeader(String key,
String value)
Add/update a request header.
|
com.sendgrid.Response |
api(com.sendgrid.Request request)
Class api sets up the request to the Twilio SendGrid API, this is main interface.
|
String |
getHost()
Get the host.
|
String |
getLibraryVersion()
Get the current library version.
|
Map<String,String> |
getRequestHeaders()
Get the request headers.
|
String |
getVersion()
Get the API version.
|
void |
initialize(String auth,
String host)
Initialize the client.
|
com.sendgrid.Response |
makeCall(com.sendgrid.Request request)
Makes the call to the Twilio SendGrid API, override this method for testing.
|
Map<String,String> |
removeRequestHeader(String key)
Remove a request header.
|
void |
setHost(String host)
Set the host.
|
void |
setVersion(String version)
Set the API version.
|
void initialize(String auth, String host)
auth - authorization header valuehost - the base URL for the APIString getLibraryVersion()
String getVersion()
void setVersion(String version)
version - the new versionMap<String,String> getRequestHeaders()
Map<String,String> addRequestHeader(String key, String value)
key - the header keyvalue - the header valueMap<String,String> removeRequestHeader(String key)
key - the header key to removeString getHost()
void setHost(String host)
host - the new hostcom.sendgrid.Response makeCall(com.sendgrid.Request request)
throws IOException
request - the request to makeIOException - in case of a network errorcom.sendgrid.Response api(com.sendgrid.Request request)
throws IOException
request - the request objectIOException - in case of a network errorCopyright © 2024. All rights reserved.