wget使用方法(some)

wget使用方法(some)

前提说明:

Web服务器http://127.0.0.1:8333/test.php 是我自己搭建的一台nginx+phpweb服务器

1 post请求

Wget默认发送Get请求,通过指定参数--post-dataor --post-file 这两个选项

e.g wget--post-data "aaaa" http://127.0.0.1:8333/test.php

wget--post-data "user=foo" http://127.0.0.1:8333/test.php

wget–post-file post_file http://127.0.0.1:8333/test.php

2 head请求

wget --debug--spider http://127.0.0.1:8333/test.php

--spider并不下载文件,通过head请求服务器,获取web服务器响应

3 –no-cache禁用缓存

e.g wget–no-cache http://127.0.0.1:8333/test.php

请求数据包头部Pragma:no-cache,不使用缓存,http1.1加上Cache-Control: no-cache, must-revalidate

4 –referer使用referer

Referrer主要用户点击的上一个页面,一般可以用做防盗链技术,防盗链可以在url后面加一个key=value加密字段,或者使用特定referer字段。

e.g wget–debug –referer www.baidu.com http://127.0.0.1:8333/test.php

5 显示wget帮助和版本信息

Wget –v or wget –h

6 –e 就是执行命令

e.g wget-e "postdata=111111111" http://localhost:8333/test.php

这种形式和wget –post-data=”11111111” http://localhost:8333/test.php是相同的。

7 logfile (-o)把debug信息输出到文件

e.g wget http://localhost:8333/test.php -ologfile

8 referer设置

e.g wget --debug --referer "www.baidu.com/dsadsa" www.baidu.com/index.html

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值