[rest-gradle-plugin] 53/83: Update the readme with documentation of the custom response handler
Alastair McKinstry
mckinstry at moszumanska.debian.org
Wed Oct 25 15:59:07 UTC 2017
This is an automated email from the git hooks/post-receive script.
mckinstry pushed a commit to branch debian/master
in repository rest-gradle-plugin.
commit 5b1305e64be5b56b198039d32ea32370b51076d0
Author: noamt <noam at 10ne.org>
Date: Sun Sep 20 17:36:41 2015 +0300
Update the readme with documentation of the custom response handler
---
README.asciidoc | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/README.asciidoc b/README.asciidoc
index a2f114b..b5f9599 100644
--- a/README.asciidoc
+++ b/README.asciidoc
@@ -21,6 +21,7 @@ The plugin adds a new task named `rest`. This task exposes the following propert
* requestContentType - The expected content type of the request. Overrides the `contentType` parameter. Type: groovyx.net.http.ContentType / String.
* requestBody - The request content. Type: Object.
* requestHeaders - Additional request headers. Type: Map.
+* responseHandler - A custom successful request handler. Type: groovy.lang.Closure. The closure accepts one parameter. May accept the types String, InputStream or Object which falls back to the client's default handler.
For example, a POST request task:
[source,groovy]
@@ -33,5 +34,9 @@ task attack(type: org._10ne.gradle.rest.RestTask) {
requestBody = [battleCry: 'FOR LEEROY JENKINS!']
contentType = groovyx.net.http.ContentType.JSON
requestHeaders = [customHeader: 'WoW']
+ responseHandler - {
+ //Configured content type is JSON and we let the client's handler parse the response for us
+ assert it.message == 'success'
+ }
}
----
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-java/rest-gradle-plugin.git
More information about the pkg-java-commits
mailing list