Skip to content

Option to record response in different format #48

@weiser

Description

@weiser

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions