Response with File
Sometimes, you need to respond with a file to incoming requests (e.g. to return contractual documents). This endpoint behaviour can be mocked with the scenario's responseFilePath attribute. It defines the path to a static file to be exposed as response. The path needs to be a string and is interpreted relatively to the script file, that defines the register() function.
The file type of referenced file is being used to auto populate the
Content-Typeresponse header.
If
responseFilePathis specified, a configuredresponseBodywould be ignored.
๐
Respond with File
Open Recipe
Updated over 3 years ago