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