Abstract base class for Asynchronous resource clients
| Modifiers | Name | Description |
|---|---|---|
protected groovy.lang.Closure |
customizer |
|
protected java.lang.String |
templatedUrl |
| Type | Name and description |
|---|---|
AsyncRestBuilder |
restBuilder |
java.lang.String |
url |
| Constructor and description |
|---|
AbstractAsyncResourcesClient
(java.lang.String url)
|
AbstractAsyncResourcesClient
(java.lang.String url, AsyncRestBuilder restBuilder) |
| Type | Name and description |
|---|---|
void |
customize(groovy.lang.Closure customizer) |
grails.async.Promise<RestResponse> |
delete(java.lang.Object id)Issues a DELETE request for the given id |
grails.async.Promise<T> |
get(java.lang.Object id, java.lang.String acceptContentType = getAcceptContentType()Issues a GET request for the given id |
java.lang.String |
getAcceptContentType()@return Subclasses should implement to provide the default content type used to exchange resources |
java.lang.Class |
getAcceptType()Subclasses should implement to provide the conversion to the target representation (JSON, XML etc.) |
grails.async.Promise<T> |
getAll(java.lang.String acceptContentType = getAcceptContentType()Issues a GET request to the configured URL |
grails.async.Promise<RestResponse> |
head(java.lang.Object id)Issues a HEAD request for the given id |
grails.async.Promise<RestResponse> |
head()Issues a HEAD request for the given id |
grails.async.Promise<RestResponse> |
options(java.lang.Object id)Issues a OPTIONS request for the given id |
grails.async.Promise<RestResponse> |
options()Issues a OPTIONS request for the given id |
grails.async.Promise<RestResponse> |
patch(java.lang.Object id, java.lang.String requestBody, java.lang.String bodyContentType = getAcceptContentType()Issues a PATCH request for the given id |
grails.async.Promise<RestResponse> |
patch(java.lang.Object id, T requestBody, java.lang.String bodyContentType = getAcceptContentType()Issues a PATCH request for the given id |
grails.async.Promise<RestResponse> |
post(T requestBody, java.lang.String bodyContentType = getAcceptContentType()Issues a POST request for the given id |
grails.async.Promise<RestResponse> |
post(java.lang.String requestBody, java.lang.String bodyContentType = getAcceptContentType()Issues a POST request for the given id |
grails.async.Promise<RestResponse> |
put(java.lang.Object id, java.lang.String requestBody, java.lang.String bodyContentType = getAcceptContentType()Issues a PUT request for the given id |
grails.async.Promise<RestResponse> |
put(java.lang.Object id, T requestBody, java.lang.String bodyContentType = getAcceptContentType()Issues a PUT request for the given id |
| Methods inherited from class | Name |
|---|---|
class java.lang.Object |
java.lang.Object#wait(long, int), java.lang.Object#wait(long), java.lang.Object#wait(), java.lang.Object#equals(java.lang.Object), java.lang.Object#toString(), java.lang.Object#hashCode(), java.lang.Object#getClass(), java.lang.Object#notify(), java.lang.Object#notifyAll() |
url - The base URL. Example http://localhost:8080/booksIssues a DELETE request for the given id
id - The idIssues a GET request for the given id
id - The idacceptContentType - The content type to pass in the ACCEPT header
Subclasses should implement to provide the conversion to the target representation (JSON, XML etc.)
restResponse - The RestResponseIssues a GET request to the configured URL
acceptContentType - The content type to pass in the ACCEPT headerIssues a HEAD request for the given id
id - The idIssues a HEAD request for the given id
id - The idIssues a OPTIONS request for the given id
id - The idIssues a OPTIONS request for the given id
id - The idIssues a PATCH request for the given id
requestBody - The requestBody of the requestIssues a PATCH request for the given id
requestBody - The requestBody of the requestIssues a POST request for the given id
requestBody - The requestBody of the requestIssues a POST request for the given id
requestBody - The requestBody of the requestIssues a PUT request for the given id
requestBody - The requestBody of the requestIssues a PUT request for the given id
requestBody - The requestBody of the request