I was going to suggest that you use filtered requests. However this is not possible with the current implementation of sinon.
excerpt from documentation:
Add a filter that will decide whether or not to fake a request. The filter will be called when xhr.open is called, with the exact same arguments (method, url, async, username, password). If the filter returns truthy, the request will not be faked.
You don't have ability to filter on the data.
EDIT: If I understand the problem correctly, you might be able to do something like this:
functionToTest(...);
var request = server.requests[0];
var data = JSON.parse(request.requestBody);
if (data.one == 'one' && data.two == 'two') {
request.respond(200, jsonHeaders, JSON.stringify(specialResponse));
}
else {
request.respond(200, jsonHeaders, JSON.stringify(otherResponse));
}
I know that code will get the correct result that you want, but there's not a way to programmatically accomplish that with sinon right now.