Curl
De Linuxmemo.
(Différences entre les versions)
| Ligne 8 : | Ligne 8 : | ||
-v # Pour voir l'échange de header | -v # Pour voir l'échange de header | ||
| + | |||
| + | ==Gestion des cookies== | ||
| + | |||
| + | CookieFileName=cookies.txt | ||
| + | curl --cookie $CookieFileName --cookie-jar $CookieFileName --user-agent Mozilla/4.0 POST --data "username={yourUserName}&password={yourPassword}" http://websiteToAuthOn.com -v | ||
| + | What this basically does is to save the Http Header information in to the cookies.txt file so we can use it later on for instance like this: | ||
| + | |||
| + | curl --cookie cookies.txt --user-agent Mozilla/4.0 -X GET http://websiteToAuthOn.com/page/you/want | ||
Version du 24 mai 2016 à 07:17
-H, --header # Pour régler les header ( autant de -H que de header)
-I # Pour recevoir que les header
-v # Pour voir l'échange de header
Gestion des cookies
CookieFileName=cookies.txt
curl --cookie $CookieFileName --cookie-jar $CookieFileName --user-agent Mozilla/4.0 POST --data "username={yourUserName}&password={yourPassword}" http://websiteToAuthOn.com -v
What this basically does is to save the Http Header information in to the cookies.txt file so we can use it later on for instance like this:
curl --cookie cookies.txt --user-agent Mozilla/4.0 -X GET http://websiteToAuthOn.com/page/you/want