How to send Cookie via Curl POST in linux

Tested in: CentOS 7, cygwin

You can send post request to a server easily via curl by typing the following in the terminal (ofcourse you will need to change the parameters):

curl --cookie "State=292b2992" -H "Content-Type: text/xml" -X POST -d '<test><value>1</value></test>' http://jahansyed.co.uk

-H : Allows you to set the headers
–cookie : This sends the cookie along with your POST request

Leave a Reply

Your email address will not be published. Required fields are marked *