yakbak
yakbak copied to clipboard
Option to record response in different format
Sometimes, when I record an HTTP interaction, I'll want to modify the body of the response later. Usually, I do not want to re-record the entire interaction, I just want to modify the currently recorded response.
One way to do this would be to modify this so that, instead of:
res.write(new Buffer('cafebeef', 'base64'))
we'd have something like:
var obj = '{"v":2}'
res.write(new Buffer(JSON.stringify(obj), 'utf8'))
It could then be surfaced in a configuration, like:
yakbak('http://myServer:3060', {
dirname: __dirname + '/../fixtures',
fixtureEncoding: 'utf8', // default would be 'base64'
}));
Is that functionality that would be beneficial? If so, I'd be happy to add it.