Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

how to pass the cookies in the curl request

Tags:

http

node.js

I have to send request using curl, in that request i needs to set the cookie from the below response. So can some one help me how to pass all the cookies in the curl request

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
like image 788
Madrini Avatar asked Feb 05 '23 14:02

Madrini


1 Answers

If you want to send multiple cookies, just sepreate them by ;

curl -v --cookie "TOKEN1=Yes;TOKEN2=no" http://127.0.0.1:5000
like image 129
Rayee Roded Avatar answered Feb 08 '23 11:02

Rayee Roded