How to use Curl from command line to post GET method with cookies
`I have this requests that i have to send with windows xp
GET https://website.com/index.aspx?typeoflink=**[HERE-VARIABLE-FROM-FILE]**&min=1 HTTP/1.1
Accept: */*
Referer: https://website.com/index.aspx?chknumbertypeoflink&min=1
Accept-Language: en-us
Accept-Encoding: gzip, deflate
User-Agent: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1)
Host: website.com
Connection: Keep-Alive
Cookie: cookieverrylongstringD%FG^&N*MJ( CVV%^B&N*&*(NHN*B*&BH*&H
and this curl code here
set TYPEOFLINK=foo
curl https://website.com/index.aspx?typeoflink=%TYPEOFLINK%&min=1 > savedfile
how can i get curl to send cookies and referer and all the others?
Th开发者_Go百科anks in advance Adam
I'm just learning about cURL and the tutorial has been a big help. I think it covers most of what you're looking for:
http://curl.haxx.se/docs/httpscripting.html
curl --insecure -c cookie.txt --url "https://website.com/index.aspx" --data "typeoflink=**[HERE-VARIABLE-FROM-FILE]**&min=1"
--insecure swtch is because you are acesssing a secured address -c flag will start the cookie engine and will save the cookie to cookie.txt. Now that you've set the cookie you can use it with -b flag, like:
curl --insecure -b cookie.txt --url "https://website.com/index.aspx" --data "typeoflink=**[HERE-VARIABLE-FROM-FILE]**&min=1"
精彩评论