gpt4 book ai didi

node.js - 如何在 curl 请求中传递 cookie

转载 作者:行者123 更新时间:2023-12-04 01:49:53 25 4
gpt4 key购买 nike

我必须使用 curl 发送请求,在该请求中我需要从下面的响应中设置 cookie。
那么有人可以帮助我如何在 curl 请求中传递所有 cookie

HTTP/1.1 200 OK  
X-Powered-By: Express
Access-Control-Allow-Origin:undefined
Access-Control-Allow-Credentials: true
Access-Control-Allow-Methods: GET,POST,OPTIONS
Access-Control-Allow-Headers: Content-Type
set-cookie: SESSIONID=agpuB2CqPDhkupxfbrZXCR; Path=/ABC
set-cookie: bac_cookie=7959aacd5cc48;Domain=abc.com;Expires=Mon, 05-Dec-2016 18:47:42 GMT; Path=/
set-cookie: beID=0023T21; Domain=abc.com; Expires=Mon,05-Dec-2016 18:47:42 GMT; Path=/
set-cookie:USER_JSESSIONID=agpuB2CqPDhkupxfbrJlbXF3;Domain=abc.com;Expires=Mon, 05-Dec-2016 18:47:42 GMT; Path=/
set-cookie:bac_user_info="UserName|UserLName|UserMailId"; Version=1;Domain=abc.com; Max-Age=3600; Path=/
set-cookie: beID=0023T21; Domain=abc.com; Expires=Mon, 05-Dec-2016 18:47:42 GMT; Path=/
set-cookie:NSC_WB2-CF-8080=ffffffff09ae530a45525d5f4f58455e445a4a4229a0;path=/;httponly
Content-Type: application/json; charset=utf-8
Content-Length: 131
ETag: W/"83-+Jfk31hxbwmLWd1hTlIO1Q"
Date: Mon, 05 Dec 2016 17:47:42 GMT
Connection: abc

最佳答案

如果您想发送多个 cookie,只需将它们隔开 ;

curl -v --cookie "TOKEN1=Yes;TOKEN2=no" http://127.0.0.1:5000

关于node.js - 如何在 curl 请求中传递 cookie,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/40981046/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com