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.
精彩评论