Skip to content

lalitkapoor/request-cookies

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

32 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

request-cookies Build Status

Cookie management for node's request library

see tests for examples

CookieJar

CookieJar()

Holds cookies

add(data, url, options)

Add a cookie to the cookie jar

Params:

  • String|Object data can be a Cookie, json object, or a set-cookie header string

  • String url

  • Object options [optional]

remove(url, key)

Remove a cookie by name for a given domain. If the key then all cookies for the given domain and path (if given) will be removed. Note: when cookies are added without a path specified the default path is "/" in accordance with http://tools.ietf.org/search/rfc6265#section-5.1.4 - so you should use that for the path param when appropriate.

Params:

  • String url

  • String key

getCookies(url, options)

Get cookies that match the given properties

Params:

  • String url

  • Object options [optional]

getCookieHeaderString(url, options)

Get HTTP Cookie header string

Params:

  • String url

  • Object options [optional]

toJSON()

Get cookie jar as a JSON object

Return:

  • Object

Cookie

Cookie(data)

HTTP Cookie

Params:

  • String|Object data can be a cookie header string or a json object

getCookieHeaderString()

Get cookie as a cookie header string

Return:

  • String

set(data)

Set multiple cookie properties at once

Params:

  • String|Object data

toJSON()

Get cookie as a JSON object

Return:

  • Object

About

Cookie management for node's request library

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published