mikeal/request — pull request #777 by lalitkapoor (2014-01-19 01:16:05+00:00)
Title: a friendly api for working with cookies

Please checkout https://github.com/lalitkapoor/request-cookies to see the api. The code is well documented too. It builds upon the really awesome work in by @stash on https://github.com/goinstant/tough-cookie

The goal is to make working with cookies as easy as possible. There's been a bunch of discussion about this in #729 and briefly in some other issues as well like #743 and #767.

Basically I've limited the API to what is necessary for this library and made some things more flexible. E.g. adding a cookie to the jar - you can now do this by passing in a cookie string, a json object or an instance of a `Cookie` object. Removing a cookie from the jar is also easy. Also added the ability to export the jar or cookie via the `toJSON` method.

/cc @stash @mikeal