How to use cURL to send Cookies?

前端 未结 5 1836
孤独总比滥情好
孤独总比滥情好 2020-11-30 17:09

I read that Send cookies with curl works, but not for me.

I have a REST endpoint as:

class LoginResource(restful.Resource):
    def get(         


        
5条回答
  •  难免孤独
    2020-11-30 17:27

    You can refer to https://curl.haxx.se/docs/http-cookies.html for a complete tutorial of how to work with cookies. You can use

    curl -c /path/to/cookiefile http://yourhost/
    

    to write to a cookie file and start engine and to use cookie you can use

    curl -b /path/to/cookiefile  http://yourhost/
    

    to read cookies from and start the cookie engine, or if it isn't a file it will pass on the given string.

提交回复
热议问题