开发者

What headers are automatically sent by wget?

I know that you can manually set some headers with the --header option, but I want to know w开发者_C百科hat headers it sends without interaction.


Using the -d (--debug) option I see it set:

---request begin---
GET / HTTP/1.0
User-Agent: Wget/1.12 (cygwin)
Accept: */*
Host: www.uml.edu
Connection: Keep-Alive

---request end---


that's easy to check: write a script that displays the sent headers or dump headers with your web server.

with PHP you need print_r(getallheaders());

Array
(
    [User-Agent] => Wget/1.11.4
    [Accept] => */*
    [Host] => localhost
    [Connection] => Keep-Alive
)

Tested with GNU Wget 1.11.4.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜