curl -o /dev/null -s -w "%{time_connect}:%{time_starttransfer}:%{time_total}\n" http://www.sina.com 返回内容如下: 0.103:0.133:0.133 通过 -o 参数发送到 /dev/null。-s 参数去掉所有状态信息。-w 参数让 curl 写出表 1 列出的计时器的状态信息: 计时器 描述: time_connect 建立到服务器的 TCP 连接所用的时间 time_starttransfer 在发出请求之后,Web 服务器返回数据的第一个字节所用的时间 time_total 完成请求所...
监控站点首页下载时间:
curl -o /dev/null -s -w ‘%{time_total}’ http://www.miotour.com
curl -o /dev/null -s -w ‘%{http_code}’ http://www.miotour.com
curl -o /dev/null -s -w %{http_code}:%{time_connect}:%{
Usage: curl [options...] Options: (H) means HTTP/HTTPS only, (F) means FTP only -a/--append Append to target file when uploading (F) -A/--user-agent User-Agent to send to server (H) --anyauth Pick "any" authentication method (H) -b/--cookie Cookie string or file to read cookies from (H) --basic Use HTTP Basic Authentication (H) -B/--use-ascii Use ASCII/text ...
今天看到curl的用法,不错记录一下。 原文地址: http://www.linuxidc.com/Linux/2008-01/10891p2.htm Linux curl使用简单介绍 curl是Linux下一个很强大的http命令行工具,其功能十分强大。 1) 二话不说,先从这里开始吧! $ curl http://www.linuxidc.com 回车之后,www.linuxidc.com 的html就稀里哗啦地显示在屏幕上了 ~ 2) 嗯,要想把读过来页面存下来,是不是要这样呢? $ curl http://www.linuxidc.com > page.html 当然可...
linux下写shell脚本程序 经常会遇到需要post提交东西的时候 这时候用curl是非常方便的 我举一个例子: curl -A "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.0)" \ -e "http://www.xxx.com/poll.shtml" \ -d "2880[]=105&pid=2880&p=最佳&count=1&receipt=1&poll=投票" \ http://survey.xxx.com/poll/poll.php 这里 -A "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.0)" 的意思就是申明自己用的是windows2000下的ie6的...
[code]#!/bin/sh hot_line=4006019977 cno_num_sub=2000 ccic_ip=xxx.xx.xxx.xx record_num_sub=1 curl -A "Mozilla/5.0 (compatible; MSIE 9.0; Windows NT 6.1; Trident/5.0)" -o output_AgentLogin.htm -D cookie_AgentLogin.txt "http://xxx.xx.xxx.xx/system%21getLoginSecurityCodeImage.action" curl -A "Mozilla/5.0 (compatible; MSIE 9.0; Windows NT 6.1; Trident/5.0)" -b cookie_AgentLogin.txt "http://xxx.xx.xxx....
本帖最后由 luwenju 于 2012-05-06 10:35 编辑 有这样一个问题: 比如用浏览器访问一个图片连接 http://192.168.1.100/test.jpg 时可正常显示图片,但是使用curl -I http://192.168.1.100/test.jpg 时获取的状态码是404,而不是200,什么问题?
用curl post数据到一个网站 但是 有像这样的
想熟悉一下curl,怎么搞也搞不明白,有没有人帮下忙,把下面这个函数改成用curl实现。 function translate($content){ $argv = array('text'=>$content, 'hl'=>'zh-CN', 'langpair'=>'zh-CN|en', 'ie'=>'UTF-8'); $params = http_build_query($argv); $length = strlen($params); $fp = fsockopen("www.google.com",80,$errno,$errstr,10) or exit($errstr.":".$errno); $header = "POST /translate...
功能强大的curl 1) 通过curl直接访问sina网站curl http://www.sina.com.cn 2) 你也可以把sina保存期来curl http://www.sina.com > sina 或 curl -o sina http://www.sina.com.cn 3) 同时可以通过代理来访问网页curl -x 10.54.38.18:8080 -o sina.html http://www.sina.com.cn 4) 可以把cookies存放到一个文件里curl -x 10.54.38.18:8080 -o sina.html -D cookie002.txt http://www.sina.com.cn 5) 下一次访问的时候,如何...