lxq.link

Linux / macOS 使用 curl

ON THIS PAGE

curl文档:https://curl.haxx.se/docs/manual.html

get the main page:

$ curl xiaoqiangli.com

save the main page to local:

$ curl xiaoqiangli.com > xiaoqiangli.html
#or
$ curl -o xiaoqiangli.html xiaoqiangli.com

ajax get:

$ curl http://www.xiaoqiangli.com/login?user=username&password=password

ajax post:

$ curl -d "user=username&password=password" http://www.xiaoqiangli.com

upload file:

#ftp
curl -T localfile -u name:passwd ftp://upload_site:port/path/

#http:
curl -T localfile http://www.xiaoqiangli.com/file

get redirect url

curl -Ls -o /dev/null -w %{url_effective} URL
2020-03-07
上一篇:Windows 命令行设置代理
下一篇:Headless Chrome和Puppeteer的使用