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