curl命令怎么用 curl常用命令及参数详解(12)
curl命令怎么用
curl https://www.secure-site.com
curl is also capable of using client certificates to get/post files from sites that require valid certificates. The only drawback is that the certificate needs to be in PEM-format. PEM is a standard and open format to store certificates with, but it is not used by the most commonly used browsers. If you want curl to use the certificates you use with your (favourite) browser, you may need to download/compile a converter that can convert your browser's formatted certificates to PEM formatted ones.
Example on how to automatically retrieve a document using a certificate with a personal password:
curl -E /path/to/cert.pem:password https://secure.site.com/
If you neglect to specify the password on the command line, you will be prompted for the correct password before any data can be received.
Many older HTTPS servers have problems with specific SSL or TLS versions, which newer versions of OpenSSL etc use, therefore it is sometimes useful to specify what SSL-version curl should use. Use -3, -2 or -1 to specify that exact SSL version to use (for SSLv3, SSLv2 or TLSv1 respectively):
curl -2 https://secure.site.com/
Otherwise, curl will attempt to use a sensible TLS default version.
Resuming File Transfers
To continue a file transfer where it was previously aborted, curl supports resume on HTTP(S) downloads as well as FTP uploads and downloads.
Continue downloading a document:
curl -C - -o file ftp://ftp.server.com/path/file
Continue uploading a document:
curl -C - -T file ftp://ftp.server.com/path/file
Continue downloading a document from a web server
curl -C - -o file http://www.server.com/
Time Conditions
HTTP allows a client to specify a time condition for the document it requests. It is If-Modified-Since or If-Unmodified-Since. curl allows you to specify them with the -z/--time-cond flag.
For example, you can easily make a download that only gets performed if the remote file is newer than a local copy. It would be made like:
curl -z local.html http://remote.server.com/remote.html
Or you can download a file only if the local file is newer than the remote one. Do this by prepending the date string with a -, as in:
curl -z -local.html http://remote.server.com/remote.html
You can specify a "free text" date as condition. Tell curl to only download the file if it was updated since January 12, 2012:
curl -z "Jan 12 2012" http://remote.server.com/remote.html
Curl will then accept a wide range of date formats. You always make the date check the other way around by prepending it with a dash (-).
DICT
For fun try
curl dict://dict.org/m:curl
curl dict://dict.org/d:heisenbug:jargon
curl dict://dict.org/d:daniel:gcide
Aliases for 'm' are 'match' and 'find', and aliases for 'd' are 'define' and 'lookup'. For example,
curl dict://dict.org/find:curl
Commands that break the URL description of the RFC (but not the DICT protocol) are
相关阅读
-
网站推广的基本方法为哪些 网络营销与策划方案
小编为网友们解答网站推广的基本方法为哪些和网络营销与策划方案方面的内容,具体详情如下: 网络世界已变成当代人不可或缺的一种生活习惯,因此,以互联网为基本的商业主题活动也日
-
定制网站建设哪家便宜好做 网页设计制作网站推荐
今天分享:定制网站建设哪家便宜好做和网页设计制作网站推荐方面的内容,接下来就是全面介绍。 网站建设如果能够做得比较好的话,一般能够给其他人留下一个比较深刻的印象,这对于任
-
网站设计制作从哪里学起 html零基础入门教程
你是不是想知道网站设计制作从哪里学起和html零基础入门教程的介绍,请看下面详细的介绍。 网站是很多人都会使用的工具,但是做网站对于大部分人来说就不是件容易的事了,在这里,把学
-
JS怎么判断奇偶数方法代码 javascript判断奇偶数代码及原理详解
javascript判断奇偶数代码 ,以及判断奇偶数的原理分享给各位JS初学者。 代码如下: !DOCTYPE htmlhtmlheadmeta charset="utf-8"meta name="viewport" content="width=device-width, initial-scale=1"title判断奇偶数/title/headb


