1URI::Fetch::Response(3)User Contributed Perl DocumentatioUnRI::Fetch::Response(3)
2
3
4

NAME

6       URI::Fetch::Response - Feed response for URI::Fetch
7

SYNOPSIS

9           use URI::Fetch;
10           my $res = URI::Fetch->fetch('http://example.com/atom.xml')
11               or die URI::Fetch->errstr;
12           print $res->content;
13

DESCRIPTION

15       URI::Fetch::Response encapsulates the response from fetching a feed
16       using URI::Fetch.
17

USAGE

19   $res->content
20       The contents of the feed.
21
22   $res->uri
23       The URI of the feed. If the feed was moved, this reflects the new URI;
24       otherwise, it will match the URI that you passed to fetch.
25
26   $res->etag
27       The ETag that was returned in the response, if any.
28
29   $res->last_modified
30       The Last-Modified date (in seconds since the epoch) that was returned
31       in the response, if any.
32
33   $res->status
34       The status of the response, which will match one of the following
35       enumerations:
36
37       ·   URI::Fetch::URI_OK()
38
39       ·   URI::Fetch::URI_MOVED_PERMANENTLY()
40
41       ·   URI::Fetch::URI_GONE()
42
43       ·   URI::Fetch::URI_NOT_MODIFIED()
44
45   $res->http_status
46       The HTTP status code from the response.
47
48   $res->http_response
49       The HTTP::Response object returned from the fetch.
50
51   $res->is_success
52   $res->is_redirect
53   $res->is_error
54       Wrappers around the "$res->response" methods of the same name, for
55       convenience.
56
57       Note: there is one difference from the behaviour of HTTP::Response.  If
58       you are using a cache and get a 304 response, but the data is retrieved
59       from the cache, then "is_success" will return true, because
60       "res->content" is usable.
61
62   $res->content_type
63       The Content-Type header from the response.
64
66       Please see the URI::Fetch manpage for author, copyright, and license
67       information.
68
69
70
71perl v5.32.0                      2020-07-28           URI::Fetch::Response(3)
Impressum