Skip to content

Grabbing server response in promise chain #20

@msiebuhr

Description

@msiebuhr

I have a need for extracting the response body (for grabbing returned state), but this feel quite wrong to do:

expect(foo, 'to yield exchange', {...})
  .then(function (exchange) {
    var body = JSON.parse(exchange.httpExchange.response._rawBody.toString('utf-8'));
    ...
   })

There wouldn't be a better way of doing this somewhere?

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