Curl
De Linuxmemo.
(Différences entre les versions)
(→Fichier de configuration) |
(→Fichier de configuration) |
||
Ligne 19 : | Ligne 19 : | ||
==Fichier de configuration== | ==Fichier de configuration== | ||
vim .curlrc | vim .curlrc | ||
- | - | + | proxy = 172.21.251.23:8080 |
- | + | noproxy = "dac-ce.aviation,lfll.aviation" | |
- | + | insecure | |
- | + | location | |
- | + | trace-ascii = curldump.txt | |
+ | cookie = curlcookie.txt | ||
+ | cookie-jar = curlcookie.txt | ||
+ | user-agent = "Mozilla/4.0 POST" |
Version du 13 décembre 2016 à 14:20
-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
Fichier de configuration
vim .curlrc proxy = 172.21.251.23:8080 noproxy = "dac-ce.aviation,lfll.aviation" insecure location trace-ascii = curldump.txt cookie = curlcookie.txt cookie-jar = curlcookie.txt user-agent = "Mozilla/4.0 POST"