title | description | author | ms.author | ms.date |
---|---|---|---|---|
Simulate slow API responses |
How to simulate slow API responses |
garrytrinder |
garrytrinder |
02/05/2025 |
Dev Proxy allows you to simulate slow API responses by using the LatencyPlugin.
Start, by enabling the plugin in your Dev Proxy configuration file:
{
"$schema": "https://raw.githubusercontent.com/dotnet/dev-proxy/main/schemas/v0.24.0/rc.schema.json",
"plugins": [
{
"name": "LatencyPlugin",
"enabled": true,
"pluginPath": "~appFolder/plugins/dev-proxy-plugins.dll",
"configSection": "latencyPlugin"
}
],
"urlsToWatch": []
}
Next, specify the minimum and maximum delay (in milliseconds) to simulate for your API.
"latencyPlugin": {
"minMs": 200,
"maxMs": 10000
}
When a response is delayed, Dev Proxy displays the total duration it was delayed for in the console output.