Curl
De Linuxmemo.
(Différences entre les versions)
(→Gestion des cookies) |
(→Fichier de configuration) |
||
Ligne 32 : | Ligne 32 : | ||
cookie-jar = curlcookie.txt | cookie-jar = curlcookie.txt | ||
user-agent = "Mozilla/4.0 POST" | user-agent = "Mozilla/4.0 POST" | ||
+ | |||
+ | -q If used as the first parameter on the command line, the curlrc config file will not be read and used. | ||
==Divers== | ==Divers== | ||
curl -s ifconfig.co | curl -s ifconfig.co |
Version actuelle en date du 12 juillet 2019 à 12:15
Voir Web Automation
-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
-k # ne pas vérifier les certificats
[modifier] 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
https://ec.haxx.se/http-auth.html
[modifier] Fichier de configuration
vim .curlrc proxy = 172.21.251.23:8080 noproxy = "dom.tld,dom2.tld" insecure location trace-ascii = curldump.txt cookie = curlcookie.txt cookie-jar = curlcookie.txt user-agent = "Mozilla/4.0 POST"
-q If used as the first parameter on the command line, the curlrc config file will not be read and used.
[modifier] Divers
curl -s ifconfig.co