Skip to content

Commit

Permalink
doc(README.md) cookie example added
Browse files Browse the repository at this point in the history
  • Loading branch information
rimiti committed Jan 15, 2019
1 parent 3192d96 commit fc1568d
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions README.md
Expand Up @@ -203,6 +203,23 @@ describe('request.agent(app)', function() {
})
```
There is another example that is introduced by the file [agency.js](https://github.com/visionmedia/superagent/blob/master/test/node/agency.js)

Here is an example where 2 cookies are set on the request.

```js
agent(app)
.get('/api/content')
.set('Cookie', ['nameOne=valueOne;nameTwo=valueTwo'])
.send()
.expect(200)
.end((err, res) => {
if (err) {
return done(err);
}
expect(res.text).to.be.equal('hey');
return done();
});
```

## API

Expand Down

0 comments on commit fc1568d

Please sign in to comment.