public interface RestRequest extends Serializable
| Modifier and Type | Method and Description |
|---|---|
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 |
RestResponse send()
HttpResonsevoid addHeader(String key, String value)
key - the header namevalue - the header valuevoid addBodyParameter(String key, String value)
key - the parameter namevalue - the parameter valuevoid 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()
Mapvoid setConnectTimeout(int duration,
TimeUnit unit)
HttpURLConnectionduration - duration of the timeoutunit - unit of time (milliseconds, seconds, etc)void setReadTimeout(int duration,
TimeUnit unit)
HttpURLConnectionduration - 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 - Copyright © 2011-2013 Seam Framework. All Rights Reserved.