• 请不要在回答技术问题时复制粘贴 AI 生成的内容
yantianqi
V2EX  ›  程序员

请求头中如何设置 cookie?

  •  
  •   yantianqi · Jan 19, 2018 · 6650 views
    This topic created in 3122 days ago, the information mentioned may be changed or developed.

    携带 cookie 认证,需要怎么设置 cookie 呢?
    怎么在请求过程中,请求头中有 cookie?

    3 replies    2018-01-19 22:14:39 +08:00
    uqf0663
        1
    uqf0663  
       Jan 19, 2018
    以 MSXML2.XMLHTTP 为例

    obj.setRequestHeader("Cookie", "a=1; b=2; c=3");
    F1024
        2
    F1024  
       Jan 19, 2018
    什么语言
    yantianqi
        3
    yantianqi  
    OP
       Jan 19, 2018
    @F1024 前台用 vue+axios
    后台是 java
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   3124 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 25ms · UTC 02:51 · PVG 10:51 · LAX 19:51 · JFK 22:51
    ♥ Do have faith in what you're doing.