
05.11.2007, 11:01
|
|
Banned
Регистрация: 12.01.2007
Сообщений: 113
Провел на форуме: 4094601
Репутация:
495
|
|
Basurman
...
2. сколько символов максимум возвращает этот же метод get?...
Код:
perldoc LWP::UserAgent
Код:
The following constructor methods are available:
$ua = LWP::UserAgent->new( %options )
This method constructs a new LWP::UserAgent object and returns it. Key/value pair arguments may be provided to set up the initial state. The following options correspond to attribute methods described below:
KEY DEFAULT
----------- --------------------
agent "libwww-perl/#.##"
from undef
conn_cache undef
cookie_jar undef
default_headers HTTP::Headers->new
max_size undef
max_redirect 7
Код:
$ua->max_size( $bytes )
Get/set the size limit for response content. The default is undef, which means that there is no limit.
If the returned response content is only partial, because the size limit was exceeded, then a "Client-Aborted" header will be added to the response.
The content might end up longer than max_size as we abort once appending a chunk of data makes the length exceed the limit.
The "Content-Length" header, if present, will indicate the length of the full content and will normally not be the same as length($res->content).
*undef - у переменной нет значения
Ответ:
метод get возвращает столько 'символов', сколько потребуется
если не объявлен UserAgent таким образом:
Код:
my $ua = LWP::UserAgent->new( max_size => ...)
|
|
|