curl usage
来源:互联网 发布:超级账本 java 编辑:程序博客网 时间:2024/06/01 09:56
-i, --include (HTTP) Include the HTTP-header in the output. The HTTP-header includes things like server-name, date of the document, HTTP-version and more... -I, --head (HTTP/FTP/FILE) Fetch the HTTP-header only! HTTP-servers feature the command HEAD which this uses to get nothing but the header of a document. When used on a FTP or FILE file, curl displays the file size and last modification time only.
Usage: -i
>curl http://baidu.com<html><meta http-equiv="refresh" content="0;url=http://www.baidu.com/"></html>
We can also ask
curl
to provide more information about the response, for example we can let it display all response headers by using the-i
switch:>curl -i http://baidu.comHTTP/1.1 200 OKDate: Thu, 29 Aug 2013 05:43:17 GMTServer: ApacheCache-Control: max-age=86400Expires: Fri, 30 Aug 2013 05:43:17 GMTLast-Modified: Tue, 12 Jan 2010 13:48:00 GMTETag: "51-4b4c7d90"Accept-Ranges: bytesContent-Length: 81Connection: Keep-AliveContent-Type: text/html<html><meta http-equiv="refresh" content="0;url=http://www.baidu.com/"></html>
Usage: -I
>curl -I http://baidu.comHTTP/1.1 200 OKDate: Thu, 29 Aug 2013 05:45:59 GMTServer: ApacheCache-Control: max-age=86400Expires: Fri, 30 Aug 2013 05:45:59 GMTLast-Modified: Tue, 12 Jan 2010 13:48:00 GMTETag: "51-4b4c7d90"Accept-Ranges: bytesContent-Length: 81Connection: Keep-AliveContent-Type: text/html
Part II
-v, --verbose Makes the fetching more verbose/talkative. Mostly useful for debugging. A line starting with ’>’ means "header data" sent by curl, ’<’ means "header data" received by curl that is hidden in normal cases, and a line starting with ’*’ means additional info provided by curl. Note that if you only want HTTP headers in the output, -i, --include might be the option you’re looking for. If you think this option still doesn’t give you enough details, consider using --trace or --trace-ascii instead. This option overrides previous uses of --trace-ascii or --trace. Use -s, --silent to make curl quiet.
Usage: -v
This command will make curl
output a lot of additional information about the whole communication:
>curl -v http://localhost:8080/myapp/myresource* About to connect() to localhost port 8080 (#0)* Trying 127.0.0.1... connected* Connected to localhost (127.0.0.1) port 8080 (#0)> GET /myapp/myresource HTTP/1.1> User-Agent: curl/7.21.7 (x86_64-unknown-linux-gnu) libcurl/7.21.7 OpenSSL/0.9.8o zlib/1.2.3 libidn/1.18 libssh2/1.4.2> Host: localhost:8080> Accept: */*>< HTTP/1.1 200 OK< Content-Type: text/plain< Date: Thu, 29 Aug 2013 06:05:53 GMT< Content-Length: 7<* Connection #0 to host localhost left intact* Closing connection #0Got it!sonora.peking.corp.yahoo.com: /home/zhishan/yahoo/cmm_daily/qe/data>curl -v http://baidu.com* About to connect() to baidu.com port 80 (#0)* Trying 220.181.111.86... connected* Connected to baidu.com (220.181.111.86) port 80 (#0)> GET / HTTP/1.1> User-Agent: curl/7.21.7 (x86_64-unknown-linux-gnu) libcurl/7.21.7 OpenSSL/0.9.8o zlib/1.2.3 libidn/1.18 libssh2/1.4.2> Host: baidu.com> Accept: */*>< HTTP/1.1 200 OK< Date: Thu, 29 Aug 2013 06:07:10 GMT< Server: Apache< Cache-Control: max-age=86400< Expires: Fri, 30 Aug 2013 06:07:10 GMT< Last-Modified: Tue, 12 Jan 2010 13:48:00 GMT< ETag: "51-4b4c7d90"< Accept-Ranges: bytes< Content-Length: 81< Connection: Keep-Alive< Content-Type: text/html<<html><meta http-equiv="refresh" content="0;url=http://www.baidu.com/"></html>* Connection #0 to host baidu.com left intact* Closing connection #0
Link: http://curl.haxx.se/
- curl usage
- Usage of CURL
- usage
- curl出现Deprecated: curl_setopt(): The usage of the @filename API for file uploading is deprecated. Pl
- curl
- curl
- CURL
- curl
- curl
- Curl
- cURL
- CURL
- curl
- curl
- curl
- curl
- curl
- curl
- Using Multiple HTML5 Canvases as Layers
- 【Android UI设计与开发】第09期:底部菜单栏(四)Fragment+PopupWindow仿QQ空间最新版底部菜单栏
- 在BIOS模式下USB的启动热键
- android 编译和环境搭建 官方地址
- golang win32编程的一个dll坑
- curl usage
- 弹出框动态居中
- CentOS 5.5 升级php到5.2,mysql到5.1 (yum安装之后的为5.1.6版本过低而升级)
- mysql各种日志
- 转载_Linux 运行时内核分析
- weka中对数值型数据离散化
- 互联网系统架构的演进
- SQL查询一列中是否有重复数据
- word图片pdf汇总编辑目录为pdf