• url_effective 最终获取的url地址,尤其是当你指定给curl的地址存在301跳转,且通过-L继续追踪的情形。
    • http_code http状态码,如200成功,301转向,404未找到,500服务器错误等。(The numerical response code that was found in the last retrieved HTTP(S) or FTP(s) transfer. In 7.18.2 the alias response_code was added to show the same info.)
    • http_connect The numerical code that was found in the last response (from a proxy) to a curl CONNECT request. (Added in 7.12.4)
    • time_total 总时间,按秒计。精确到小数点后三位。 (The total time, in seconds, that the full operation lasted. The time will be displayed with millisecond resolution.)
    • time_namelookup DNS解析时间,从请求开始到DNS解析完毕所用时间。(The time, in seconds, it took from the start until the name resolving was completed.)
    • time_connect 连接时间,从开始到建立TCP连接完成所用时间,包括前边DNS解析时间,如果需要单纯的得到连接时间,用这个time_connect时间减去前边time_namelookup时间。以下同理,不再赘述。(The time, in seconds, it took from the start until the TCP connect to the remote host (or proxy) was completed.)
    • time_appconnect 连接建立完成时间,如SSL/SSH等建立连接或者完成三次握手时间。(The time, in seconds, it took from the start until the SSL/SSH/etc connect/handshake to the remote host was completed. (Added in 7.19.0))
    • time_pretransfer 从开始到准备传输的时间。(The time, in seconds, it took from the start until the file transfer was just about to begin. This includes all pre-transfer commands and negotiations that are specific to the particular protocol(s) involved.)
    • time_redirect 重定向时间,包括到最后一次传输前的几次重定向的DNS解析,连接,预传输,传输时间。(The time, in seconds, it took for all redirection steps include name lookup, connect, pretransfer and transfer before the final transaction was started. time_redirect shows the complete execution time for multiple redirections. (Added in 7.12.3))
    • time_starttransfer 开始传输时间。在发出请求之后,Web 服务器返回数据的第一个字节所用的时间(The time, in seconds, it took from the start until the first byte was just about to be transferred. This includes time_pretransfer and also the time the server needed to calculate the result.)
    • size_download 下载大小。(The total amount of bytes that were downloaded.)
    • size_upload 上传大小。(The total amount of bytes that were uploaded.)
      size_header 下载的header的大小(The total amount of bytes of the downloaded headers.)
    • size_request 请求的大小。(The total amount of bytes that were sent in the HTTP request.)
    • speed_download 下载速度,单位-字节每秒。(The average download speed that curl measured for the complete download. Bytes per second.)
    • speed_upload 上传速度,单位-字节每秒。(The average upload speed that curl measured for the complete upload. Bytes per second.)
    • content_type 就是content-Type,不用多说了,这是一个访问我博客首页返回的结果示例(text/html; charset=UTF-8);(The Content-Type of the requested document, if there was any.)
    • num_connects 最近的的一次传输中创建的连接数目。Number of new connects made in the recent transfer. (Added in 7.12.3)
    • num_redirects 在请求中跳转的次数。Number of redirects that were followed in the request. (Added in 7.12.3)
    • redirect_url When a HTTP request was made without -L to follow redirects, this variable will show the actual URL a redirect would take you to. (Added in 7.18.2)
    • ftp_entry_path 当连接到远程的ftp服务器时的初始路径。The initial path libcurl ended up in when logging on to the remote FTP server. (Added in 7.15.4)
    • ssl_verify_result ssl认证结果,返回0表示认证成功。( The result of the SSL peer certificate verification that was requested. 0 means the verification was successful. (Added in 7.19.0))
       
       
    • 案例:                                取http状态码:  curl -I -o /dev/null -s -w "%{http_code}\n" web02

curl -w函数的更多相关文章

  1. curl -w,–write-out参数详解

    顾名思义,write-out的作用就是输出点什么.curl的-w参数用于在一次完整且成功的操作后输出指定格式的内容到标准输出. 输出格式由普通字符串和任意数量的变量组成,输出变量需要按照%{varia ...

  2. Linux - curl -w 参数详解

    -w 的作用 完成请求传输后,使 curl 在 stdout 上显示自定义信息 格式是一个字符串,可以包含纯文本和任意数量的变量 输出格式 输出格式中的变量会被 curl 用对应的值替换掉 所有变量的 ...

  3. 使用file_get_content系列函数和使用curl系列函数采集图片的性能对比

    由于公司的一个汽车网站的后台的汽车内容都是主要是来自与汽车之家的,编辑的同事们必须天天手动去对着汽车之家来添加汽车,实在是太蛋疼了.于是乎,为了改变这种状况,作为一个开发码农,我的任务就来了...那就 ...

  4. Curl常用函数介绍

    一.LibCurl基本编程框架 在基于LibCurl的程序里,主要采用callback function (回调函数)的形式完成传输任务,用户在启动传输前设置好各类参数和回调函数,当满足条件时libc ...

  5. curl -w参数简析

    curl的-w参数用于在一次完整且成功的操作后输出指定格式的内容到标准输出. 输出格式由普通字符串和任意数量的变量组成,输出变量需要按照%{variable_name}的格式,如果需要输出%,doub ...

  6. <记录> curl 封装函数

    1. POST请求 参数1 : 请求地址 参数2 : 数组形式的参数 /** * @param string $url post请求地址 * @param array $params * @retur ...

  7. shell常用命令之curl: -w,–write-out参数详解

    顾名思义,write-out的作用就是输出点什么.curl的-w参数用于在一次完整且成功的操作后输出指定格式的内容到标准输出. 输出格式由普通字符串和任意数量的变量组成,输出变量需要按照%{varia ...

  8. 详解php的curl几个函数

    关于php的curl一系列函数,这里解释一下它们的作用. 在html中,我们可以通过form设置http的post和get提交,但假如我们获取的数据不是从html中来的,而是php脚本主动向其他服务器 ...

  9. PHP7函数大全(4553个函数)

    转载来自: http://www.infocool.net/kb/PHP/201607/168683.html a 函数 说明 abs 绝对值 acos 反余弦 acosh 反双曲余弦 addcsla ...

随机推荐

  1. T-SQL查询进阶--SQL Server中的事务与锁

    为什么需要锁 在任何多用户的数据库中,必须有一套用于数据修改的一致的规则,当两个不同的进程试图同时修改同一份数据时,数据库管理系统(DBMS)负责解决它们之间潜在的冲突.任何关系数据库必须支持事务的A ...

  2. .NET中的程序集

    参考:http://blog.sina.com.cn/s/blog_7ade159d0102wmg9.html 程序集(Assembly,装配件,.NET程序集) 程序集是应用程序的部署单元,.NET ...

  3. IP地址和子网划分

    前期知识准备 二进制 和十进制 二进制数据是用0和1表示的数,进位规则为缝二进1, 二进制和十进制的关系 二进  十进 0 1 10 2 100  4 1000 8    10000 16 10000 ...

  4. Charles设置可抓https的包

    一.help 二.proxy

  5. Navicat 远程连接 MySQL

    Navicat 远程连接 MySQL 相信大家都有在远程服务器上进行开发吧,其中 MySQL 的使用率应该也会挺高,如果使用 Navicat 等可视化工具来操作远程数据库不失为一种很好的选择,避免了在 ...

  6. SimpleDateFormat线程不安全及解决办法

    原文链接:https://blog.csdn.net/csdn_ds/article/details/72984646 以前没有注意到SimpleDateFormat线程不安全的问题,写时间工具类,一 ...

  7. 数组常用的API——splice()截取

    他的几个作用:截取  删除  增加  替换. 当传递一个参数的时候 : 截取开始的位置,参数代表下标,默人会截取到结束的位置. 当传递两个参数的时候: 第一个参数是删除的下标: 第二个参数代表删除几个 ...

  8. Mac的Parallels在启动Win的时候让它独立全屏窗口

    这里备忘一下,由于经常需要***,Win方法比较多少,所以使用Parallels在Win下***还是很有必要的,为了使用使用方便,一般让Parallels启动系统之后自动生成一个独立的全窗口,方便来回 ...

  9. (WIN7)delphi7运行关闭出现cannot creat file"C:\program file\borland\delphi7\bin\initcc32.exe拒绝访问

    1. 程序右键,以管理权限运行.2. 将Delphi7目录只读取消.WIN7以上的操作系统正常运行程序不是以管理员方式运行的

  10. (STM32F4) External Interrupt

    外部中斷(External Interupt) 在MCU中是很常見而且很常用到的基本function,所以就不多做解釋.不過因為每顆MCU的配置都不太一樣所以在此記錄下來. External Inte ...