开发者

What headers are automatically sent by wget?

开发者 https://www.devze.com 2023-03-24 05:03 出处:网络
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:

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

精彩评论

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