tomakehurst/wiremock — pull request #189 by manimales (2014-11-10 16:40:07+00:00)
Title: Scriptable response body

Adds the ability to dynamically generate a response body from JavaScript, somewhat akin to SoapUI's [dynamic content generation](http://www.soapui.org/Service-Mocking/simulating-complex-behaviour.html). The request URL is injected into the script engine and is available via the "request" variable. The script must be base64-encoded.

The use case that drove this implementation required me to return content specific to some fields in the request URL. Without this feature, the number of stubs needed to mock these particular responses (using regular expressions) was N choose K.

I created this PR figuring this might be useful to other folks and I take no offense if you want to scrap it. I'm also happy to make any suggested changes -- this is just a minimal implementation.

-Pat