javascript - (node.js) How to get cookies from remote server? -
in php, getting cookies sent remote server matter of using curl cookie handling option enabled.
if treat server client making requests remote server, wondering how might done in node.js? server/app receiving these cookies? if so, how can name , values of these cookies?
i've tried using following node.js modules no avail:
- request (??? not part of functionality?)
- tough-cookie (not part of functionality)
- client-http (i empty array)
- node-curl (i empty array)
any pointers appreciated. thanks!
you can use http
module comes node.js
var http = require('http'); http.get('http://www.google.ca', function(res) { console.log(res.headers['set-cookie']); });
will give cookies google.ca
try set on when visit.
Comments
Post a Comment