Intro to Scripts
Apidog contains a Javascript-based scripting engine. You can use scripts (JavaScript code snippets) to add dynamic behavior to API requests or collection tests.
Preprocessor Scripts
A preprocessor script is a code snippet that is executed before the request is sent. This is useful when you want to include a timestamp in the request header or send a random alphanumeric string in the URL parameters.
Postprocessor Scripts
Postprocessor script is a code snippet that is executed after the request has been sent. It is mainly used to assert whether the result returned by the request is correct or not, write the result data returned by the request to environment variables, etc.
Public Scripts
Public scripts are designed to re-use scripts and avoid repetitions of the same scripts in different places.
Script API Reference
3 items
Script Example
5 items