|
||||||||||
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 |
addHeader(String key,
String value)
Add an HTTP Header to the Request |
void |
addPayload(String payload)
Add body payload. |
void |
addQuerystringParameter(String key,
String value)
Add a QueryString parameter |
String |
getBodyContents()
|
Map<String,String> |
getBodyParams()
Obtains a Map of the body parameters. |
Map<String,String> |
getHeaders()
Returns the connection headers as a Map |
Map<String,String> |
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 |
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 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 requestMap<String,String> getQueryStringParams()
Map
of the query string parameters.
OAuthException
- if the URL is not validMap<String,String> 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)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |