V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
1423
V2EX  ›  Node.js

node.js http client 如何发送任意头

  •  
  •   1423 · 2014-04-25 20:56:48 +08:00 · 3252 次点击
    这是一个创建于 3625 天前的主题,其中的信息可能已经有所发展或是发生改变。
    想做个模拟登陆,用 Fiddler 抓取,Raw 中有以下
    ```
    POST http://example.com HTTP/1.1
    Accept: */*
    Content-Type: text/plain
    Accept-Language: zh-cn
    Accept-Encoding: gzip, deflate
    User-Agent: Mozilla/5.0 (Windows NT 6.3; WOW64; Trident/7.0; rv:11.0) like Gecko
    Host: example.com
    Content-Length: xxx
    DNT: 1
    Connection: Keep-Alive
    Pragma: no-cache
    Cookie: JSESSIONID=xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx

    callCount=1
    page=/xxx/xxx/main.jsp
    httpSessionId=
    scriptSessionId=xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
    c0-scriptName=dwrMonitor
    c0-methodName=getFrmtipsByuserId
    c0-id=0
    batchId=0

    ```

    想知道 Cookie 以下的内容如何发送?
    7 条回复    2015-07-23 13:40:37 +08:00
    pubby
        1
    pubby  
       2014-04-25 21:43:29 +08:00
    Cookie以下的是POST内容吧
    1423
        2
    1423  
    OP
       2014-04-25 22:10:17 +08:00
    @pubby 我傻了。。抱歉。。
    julyclyde
        3
    julyclyde  
       2014-04-26 20:52:13 +08:00
    @pubby POST内容为什么不是&连接起来的?这风格好诡异啊
    pubby
        4
    pubby  
       2014-04-26 23:40:14 +08:00 via Android
    @julyclyde 抓包软件的问题吧
    1423
        5
    1423  
    OP
       2014-04-27 00:52:21 +08:00
    @julyclyde
    @pubby
    求你们不要回复了。
    问这样的问题。。好丢人。
    manoon
        6
    manoon  
       2014-05-01 17:48:39 +08:00
    楼主好可爱~~~
    zonghua
        7
    zonghua  
       2015-07-23 13:40:37 +08:00
    GBK问题你们是怎么解决的?
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   我们的愿景   ·   实用小工具   ·   961 人在线   最高记录 6543   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 25ms · UTC 20:43 · PVG 04:43 · LAX 13:43 · JFK 16:43
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.