Microsoft’s Dev Proxy puts APIs to the test

There are three parts to a Dev Proxy configuration. The first is common to all configurations and details the schema used for configuration. This needs to be the version for the Dev Proxy release you’re using and a link to the file on GitHub. Next is a list of the plug-ins being used. Finally, the application configuration data: the APIs being watched, the errors being injected, and the rate limit that’s applied to calls. Plug-ins may have their own configuration data that’s applied when the plug-in is loaded.

One key feature of Dev Proxy is that it’s selective. You can let some API calls pass through, apply errors and rate limits to others, and intercept still more, redirecting calls to Dev Proxy-hosted mocks. This flexibility allows you to pick and choose what is tested and how. Finding the APIs to intercept requires using the proxy as a transparent proxy, discovering and recording all requests from a specific process. (You need to specify this, as otherwise Dev Proxy will record all network requests from every application on your PC.)

Armed with a list of URLs, you can now add the tests you want to apply to your code, intercepting requests for specific addresses and delivering mock responses. You first need to load the MockResponsePlugin and give it a list of API calls and the associated responses.

Donner Music, make your music with gear
Multi-Function Air Blower: Blowing, suction, extraction, and even inflation

Leave a reply

Please enter your comment!
Please enter your name here