From ee183eeb423a8ffe3e3b1191b5458a3506f952b4 Mon Sep 17 00:00:00 2001 From: Veselin Todorov Date: Thu, 30 Jan 2014 23:01:53 +0200 Subject: [PATCH] Add example how one could modify the options passed to request --- README.md | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/README.md b/README.md index 3992d3b..b1e4745 100644 --- a/README.md +++ b/README.md @@ -75,6 +75,20 @@ hippie() if (err) throw err; }); ``` +With middlewares you can modify the options passed to `request`. Here is an +example how you could persist the cookies across multiple requests: + +```js +hippie(app) +.get('/') +.use(persistCookies) +.end(function() {}); + +function persistCookies(opts, next) { + opts.jar = true; + next(opts); +} +``` ### Serializers and parsers