How to use cURL to send Cookies?

前端 未结 5 1832
孤独总比滥情好
孤独总比滥情好 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:18

    You are using a wrong format in your cookie file. As curl documentation states, it uses an old Netscape cookie file format, which is different from the format used by web browsers. If you need to create a curl cookie file manually, this post should help you. In your example the file should contain following line

    127.0.0.1   FALSE   /   FALSE   0   USER_TOKEN  in
    

    having 7 TAB-separated fields meaning domain, tailmatch, path, secure, expires, name, value.

提交回复
热议问题