Template
The following values are analyzed as a Groovy pattern:
Response header value
Response body (
body
)Response filename (
file
)Table key (
key
oftables
)
The following variables are available in a script block ${}
.
path
Path variables
headers
Request headers
params
Query parameters
query
Query parameters (alternative name for params
)
body
Request body
requestBody
Request body (alternative name for body
)
The request body type can be one of the following:
application/x-www-form-urlencoded
Map<String, String>
multipart/form-data
Map<String, Part>
application/json
and subset
Map<String, Object>
application/xml
and subset, text/xml
and subset
Map<String, Object>
text/*
String
Otherwise
null
For example, create a manifest as follows:
The stub will return the following response on the request GET /users/100
:
File templating
The files also support scripts
Last updated