|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
public interface RestRequest
| Method Summary | |
|---|---|
void |
addBodyParameter(String key,
String value)
Add a body Parameter (for POST/ PUT Requests) |
void |
addBodyParameters(Map<String,? extends Object> toAdd)
|
void |
addHeader(String key,
String value)
Add an HTTP Header to the Request |
void |
addPayload(byte[] payload)
|
void |
addPayload(String payload)
Add body payload. |
void |
addQuerystringParameter(String key,
String value)
Add a QueryString parameter |
String |
getBodyContents()
|
RestParameterList |
getBodyParams()
Obtains a Map of the body parameters. |
String |
getCharset()
|
String |
getCompleteUrl()
|
Map<String,String> |
getHeaders()
Returns the connection headers as a Map |
RestParameterList |
getQueryStringParams()
Get a Map of the query string parameters. |
String |
getSanitizedUrl()
Returns the URL without the port and the query string part. |
String |
getUrl()
Obtains the URL of the HTTP Request. |
RestVerb |
getVerb()
|
RestResponse |
send()
Execute the request and return a HttpResonse |
void |
setCharset(String charsetName)
|
void |
setConnectionKeepAlive(boolean connectionKeepAlive)
|
void |
setConnectTimeout(int duration,
TimeUnit unit)
Sets the connect timeout for the underlying HttpURLConnection |
void |
setReadTimeout(int duration,
TimeUnit unit)
Sets the read timeout for the underlying HttpURLConnection |
| Method Detail |
|---|
RestResponse send()
HttpResonse
void addHeader(String key,
String value)
key - the header namevalue - the header value
void addBodyParameter(String key,
String value)
key - the parameter namevalue - the parameter valuevoid addBodyParameters(Map<String,? extends Object> toAdd)
void addQuerystringParameter(String key,
String value)
key - the parameter namevalue - the parameter valuevoid addPayload(String payload)
payload - the body of the requestRestParameterList getQueryStringParams()
Map of the query string parameters.
OAuthException - if the URL is not validRestParameterList getBodyParams()
Map of the body parameters.
String getUrl()
String getSanitizedUrl()
String getBodyContents()
RestVerb getVerb()
Map<String,String> getHeaders()
Map
void setConnectTimeout(int duration,
TimeUnit unit)
HttpURLConnection
duration - duration of the timeoutunit - unit of time (milliseconds, seconds, etc)
void setReadTimeout(int duration,
TimeUnit unit)
HttpURLConnection
duration - duration of the timeoutunit - unit of time (milliseconds, seconds, etc)String getCompleteUrl()
void addPayload(byte[] payload)
payload - String getCharset()
void setCharset(String charsetName)
charsetName - void setConnectionKeepAlive(boolean connectionKeepAlive)
connectionKeepAlive -
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||