添加链接
link之家
链接快照平台
  • 输入网页链接,自动生成快照
  • 标签化管理网页链接
curl     URL          #获取该网址的文本信息
         -i  URL      #获取该网址的文本信息以及协议头部信息 
	     -x 47.94.151.148:80 zhujy.com.cn             #使用代理获取网页文本信息
	     -I url       #仅返回请求头部信息
	     -C/continue-at                             # 断点续转
	     -v           #参数可以显示一次http通信的整个过程,包括端口连接和http request头信息
	     -V           #show the version of curl

curl -O http://10.167.209.1:1212/hongtabank/ #下载指定ip底下的hongtabank文件

curl www.zhujy.com  #获取该网址的文本信息
这就是获取的www.zhujy.com信息
<!DOCTYPE html>
<title>Welcome to nginx!</title>
<style>
    body {
        width: 35em;
        margin: 0 auto;
        font-family: Tahoma, Verdana, Arial, sans-serif;
</style>
</head>
<h1>Welcome to nginx!</h1>
<p>If you see this page, the nginx web server is successfully installed and
working. Further configuration is required.</p>
<p>For online documentation and support please refer to
<a href="http://nginx.org/">nginx.org</a>.<br/>
Commercial support is available at
<a href="http://nginx.com/">nginx.com</a>.</p>
<p><em>Thank you for using nginx.</em></p>
</body>
</html>
curl  -i www.zhujy.com  #获取的www.zhujy.com文本信息以及协议头部信息
HTTP/1.1 200 OK
Server: nginx/1.14.0
Date: Mon, 11 Mar 2019 02:06:55 GMT
Content-Type: text/html
Content-Length: 612
Last-Modified: Mon, 29 Oct 2018 09:52:22 GMT
Connection: keep-alive
ETag: "5bd6d856-264"
Accept-Ranges: bytes
<!DOCTYPE html>
<title>Welcome to nginx!</title>
<style>
    body {
        width: 35em;
        margin: 0 auto;
        font-family: Tahoma, Verdana, Arial, sans-serif;
</style>
</head>
<h1>Welcome to nginx!</h1>
<p>If you see this page, the nginx web server is successfully installed and
working. Further configuration is required.</p>
<p>For online documentation and support please refer to
<a href="http://nginx.org/">nginx.org</a>.<br/>
Commercial support is available at
<a href="http://nginx.com/">nginx.com</a>.</p>
<p><em>Thank you for using nginx.</em></p>
</body>
</html>
curl -x 47.94.151.148:80 zhujy.com.cn  #使用代理获取网页文本信息
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
        <title>Test Page for the Nginx HTTP Server on Fedora</title>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
        <style type="text/css">
            /*<![CDATA[*/
            body {
                background-color: #fff;
                color: #000;
                font-size: 0.9em;
                font-family: sans-serif,helvetica;
                margin: 0;
                padding: 0;
            :link {
                color: #c00;
            :visited {
                color: #c00;
            a:hover {
                color: #f50;
                text-align: center;
                margin: 0;
                padding: 0.6em 2em 0.4em;
                background-color: #294172;
                color: #fff;
                font-weight: normal;
                font-size: 1.75em;
                border-bottom: 2px solid #000;
            h1 strong {
                font-weight: bold;
                font-size: 1.5em;
                text-align: center;
                background-color: #3C6EB4;
                font-size: 1.1em;
                font-weight: bold;
                color: #fff;
                margin: 0;
                padding: 0.5em;
                border-bottom: 2px solid #294172;
                display: none;
            .content {
                padding: 1em 5em;
            .alert {
                border: 2px solid #000;
            img {
                border: 2px solid #fff;
                padding: 2px;
                margin: 2px;
            a:hover img {
                border: 2px solid #294172;
            .logos {
                margin: 1em;
                text-align: center;
            /*]]>*/
        </style>
    </head>
        <h1>Welcome to <strong>nginx</strong> on Fedora!</h1>
        <div class="content">
            <p>This page is used to test the proper operation of the
            <strong>nginx</strong> HTTP server after it has been
            installed. If you can read this page, it means that the
            web server installed at this site is working
            properly.</p>
            <div class="alert">
                <h2>Website Administrator</h2>
                <div class="content">
                    <p>This is the default <tt>index.html</tt> page that
                    is distributed with <strong>nginx</strong> on
                    Fedora.  It is located in
                    <tt>/usr/share/nginx/html</tt>.</p>
                    <p>You should now put your content in a location of
                    your choice and edit the <tt>root</tt> configuration
                    directive in the <strong>nginx</strong>
                    configuration file
                    <tt>/etc/nginx/nginx.conf</tt>.</p>
                </div>
            </div>
            <div class="logos">
                <a href="http://nginx.net/"><img
                    src="nginx-logo.png" 
                    alt="[ Powered by nginx ]"
                    width="121" height="32" /></a>
                <a href="http://fedoraproject.org/"><img 
                    src="poweredby.png" 
                    alt="[ Powered by Fedora ]" 
                    width="88" height="31" /></a>
            </div>
        </div>
    </body>
</html>
curl -I www.zhujy.com.cn  #仅返回请求头部信息
HTTP/1.1 200 OK
Server: nginx/1.14.0
Date: Mon, 11 Mar 2019 03:34:29 GMT
Content-Type: text/html
Content-Length: 612
Last-Modified: Mon, 29 Oct 2018 09:52:22 GMT
Connection: keep-alive
ETag: "5bd6d856-264"
Accept-Ranges: bytes
                    基本指标curl     URL          #获取该网址的文本信息         -i  URL      #获取该网址的文本信息以及协议头部信息 	     -x 47.94.151.148:80 zhujy.com.cn             #使用代理获取网页文本信息	     -I url       #仅返回请求头部信息	     -C/–continue-at                             # 断点续转	     -v           #Ma
				
curl命令查看请求响应时间 # curl -o /dev/null -s -w %{time_namelookup}::%{time_connect}::%{time_starttransfer}::%{time_total}::%{speed_download}"\n" http://www.36nu.com 0.014::0.015::0.018::0.019::1516256.00 -o:把curl 返回的html、js 写到垃圾回收站[ /dev/null] -s:去掉所有状态 -w:按照后面的格式写出rt time_namelookup:DNS 解析域名www.36nu.com的
time_namelookup:%{time_namelookup} time_connect:%{time_connect} time_appconnect:%{time_appconnect} time_pretransfer:%{time_pretransfer} time_redirect:%{time_redirect} time_starttransfer:%{time_starttransfer} ---------- time_total:% 提交数据到https时,需要pem证书来加密。 我们使用浏览器访问https的时候,浏览器会自动加载网站的安全证书进行加密。但是你用curl请求https时,没有通过浏览器,就只有自己手动增加一个安全证书进行加密。 $curl=curl_init(); curl_setopt ( $curl, CU...
百度 AIP 开放平台使用 OAuth2.0 授权调用开放 API,调用 API 时必须在 URL 中带上 access_token 参数。 请求 URL 数据格式 授权服务地址:https://aip.baidubce.com/oauth/2.0/token 请求参数如下: grant_type: 必须参数,固定为 client_credentials; client_id: 必须参数,应用的...