> We would like the fake server to flex the returned response based on
> parameters specified in the request body in addition to the url even for
> (especially for) GET transactions. Unfortunately, the send function only
> copies data into the requestBody of the fake request if
> {code} !/^(get|head)$/i.test(this.method) {code}. Moving the requestBody
> set statement out of that branch, allowed us to proceed as desired. Is
> there a specific motivation for not always setting the requestBody equal to
> data?
As far as I know, this is how HTTP works. There's no requestBody with a
GET request - the parameters are part of the URL.
> We had some trouble figuring out how to make the fake server flex its reply
> as indicated in the documentation ("When the response is a function...").
> We eventually found the solution by looking at the "responds to request
> from function handler" test in fake_server_tests.js. Adding a similar
> example to the documentation might save others from having the same
> struggles.
I gladly accept pull requests for
http://github.com/cjohansen/sinon-web :)
Christian