{{}}
)along with the following special methods to make your responses dynamic -
urlParam
You can define parameters inside the mock endpoint using a colon (:
). For example - the endpoint/book/:id
defines theid
parameter that can be used inside the body of your mocks as{{urlParam 'id'}}
-
header
The value of any of the request headers can be dynamically rendered into your response using this method. For example - the string{{header 'content-type'}}
renders the value of the content-type header -
method
: You can add the request method to your mock’s response body by including{{method}}
in your mock response -
statusCode
: Renders the original status code inside the template