From ff5e99190c30d00b8e13cc087780654d5410c779 Mon Sep 17 00:00:00 2001 From: buildmaster Date: Tue, 30 Aug 2016 09:20:11 +0000 Subject: [PATCH] Sync docs from master to gh-pages --- spring-cloud-contract.html | 25 +++++++++++++++++++++++-- 1 file changed, 23 insertions(+), 2 deletions(-) diff --git a/spring-cloud-contract.html b/spring-cloud-contract.html index 72dda36236..e59c70f851 100644 --- a/spring-cloud-contract.html +++ b/spring-cloud-contract.html @@ -1891,7 +1891,7 @@ Groovy Map notation. request { //... - // Currently only JSON format of request body is supported. + // JSON and XML formats of request body are supported. // Format will be determined from a header or body's content. body '''{ "login" : "john", "name": "John The Contract" }''' } @@ -1902,6 +1902,27 @@ Groovy Map notation. } +
+

Body’s format can also be specified explicitly by invoking one of format functions.

+
+
+
+
org.springframework.cloud.contract.spec.Contract.make {
+	request {
+		//...
+
+		// In this case body will be formatted as XML.
+		body equalToXml(
+				'''<user><login>john</login><name>John The Contract</name></user>'''
+		)
+	}
+
+	response {
+		//...
+	}
+}
+
+

Response

@@ -5389,7 +5410,7 @@ number of different ways, including as described above using