Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/node.js/38.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Cookies Node.js http.ClientRequest:获取原始头_Cookies_Node.js - Fatal编程技术网

Cookies Node.js http.ClientRequest:获取原始头

Cookies Node.js http.ClientRequest:获取原始头,cookies,node.js,Cookies,Node.js,我正在使用Node.js 0.2.3和response.headers['set-cookie']似乎在第一个cookie之后被截断。我有没有办法直接读取原始标题 顺便说一句,set cookie头应该包含: id1=sw34rwdsfsd;secure; id2=wer235sd2354;secure; id3=df435df4543;secure 我猜它没有正确解析布尔属性,在第一个属性之后停止。有人知道Node.js的更高版本是否修复了这一问题(即使我现在还不能升级) I标志只要求cur

我正在使用Node.js 0.2.3和response.headers['set-cookie']似乎在第一个cookie之后被截断。我有没有办法直接读取原始标题

顺便说一句,set cookie头应该包含:

id1=sw34rwdsfsd;secure;
id2=wer235sd2354;secure;
id3=df435df4543;secure
我猜它没有正确解析布尔属性,在第一个属性之后停止。有人知道Node.js的更高版本是否修复了这一问题(即使我现在还不能升级)

I标志只要求curl输入标题。将任何编码传递给setEncoding——我认为它默认为您要查找的原始数据


I标志只要求curl输入标题。将任何编码传递给setEncoding——我认为它默认为您要查找的原始数据

无论如何,我真的建议使用node的更新版本。该团队表示,0.4API将非常稳定,自0.2以来发生了很多变化。您等待的时间越长,迁移就越困难。无论如何,我建议您使用更新版本的node。该团队表示,0.4API将非常稳定,自0.2以来发生了很多变化。等待的时间越长,迁移就越困难。
    var spawn = require('child_process').spawn;

    function getHeader(url, callback){
      var client = spawn('curl', ['-I', url]);
      client.stdout.setEncoding('***');
      client.stdout.on('data', function(data){
        callback(data);
      });
    }