cht.sh
- [root@VM_0_14_centos ~]# curl cht.sh/curl
- # Download a single file
- curl http://path.to.the/file
-
- # Download a file and specify a new filename
- curl http://example.com/file.zip -o new_file.zip
-
- # Download multiple files
- curl -O URLOfFirstFile -O URLOfSecondFile
-
- # Download all sequentially numbered files (1-24)
- curl http://example.com/pic[1-24].jpg
-
- # Download a file and follow redirects
- curl -L http://example.com/file
-
- # Download a file and pass HTTP Authentication
- curl -u username:password URL
-
- # Download a file with a Proxy
- curl -x proxysever.server.com:PORT http://addressiwantto.access
-
- # Download a file from FTP
- curl -u username:password -O ftp://example.com/pub/file.zip
-
- # Get an FTP directory listing
- curl ftp://username:password@example.com
-
- # Resume a previously failed download
- curl -C - -o partial_file.zip http://example.com/file.zip
-
- # Fetch only the HTTP headers from a response
- curl -I http://example.com
-
- # Fetch your external IP and network info as JSON
- curl http://ifconfig.me/all/json
-
- # Limit the rate of a download
- curl --limit-rate 1000B -O http://path.to.the/file
-
- # POST to a form
- curl -F "name=user" -F "password=test" http://example.com
-
- # POST JSON Data
- curl -H "Content-Type: application/json" -X POST -d '{"user":"bob","pass":"123"}' http://example.com
-
- # POST data from the standard in / share data on sprunge.us
- curl -F 'sprunge=<-' sprunge.us
看看Python的requests怎么用
- [root@VM_0_14_centos ~]# curl cheat.sh/python/requests
- # python-requests: Limit Number of Redirects Followed
- #
- # You have to create Session (http://www.python-
- # requests.org/en/latest/api/requests.Session) object and set
- # max_redirects variable to 3
-
- session = requests.Session()
- session.max_redirects = 3
- session.get(url)
-
- # TooManyRedirects exception will be raised if a requests exceeds
- # maximum number of redirects.
- #
- # Related github issue discussing why you can not set max_redirects per
- # request https://github.com/kennethreitz/requests/issues/1300
- #
- # [Alik] [so/q/31552627] [cc by-sa 3.0]
它也有网页版 http://cht.sh/curl
有了tldr和cheat,再也不用记那么多命令行参数了。
win下执行命令行的工具我常用cmder,如果你用的win10,可以尝试下微软最新发布的Terminal https://github.com/microsoft/Terminal 【责任编辑:庞桂玉 TEL:(010)68476606】
点赞 0
(编辑:ASP站长网)
|