Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Option to record response in different format #48

Open
weiser opened this issue Oct 10, 2018 · 0 comments
Open

Option to record response in different format #48

weiser opened this issue Oct 10, 2018 · 0 comments

Comments

@weiser
Copy link

weiser commented Oct 10, 2018

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant