---
name: "URI::Fetch::Response"
section: "3pm"
platform: "linux"
package: "liburi-fetch-perl"
version: "0.15-1"
release: "Debian 13 (Trixie)"
platforms: ["linux"]
url: "https://new.carta.tech/URI::Fetch::Response"
---

# URI::Fetch::Response(3pm)

Feed response for URI::Fetch

## NAME

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

## SYNOPSIS

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

## DESCRIPTION

*URI::Fetch::Response* encapsulates the response from fetching a feed using *URI::Fetch*.

## USAGE

### $res-\>content

The contents of the feed.

### $res-\>uri

The URI of the feed. If the feed was moved, this reflects the new URI; otherwise, it will match the URI that you passed to *fetch*.

### $res-\>etag

The ETag that was returned in the response, if any.

### $res-\>last\_modified

The Last-Modified date (in seconds since the epoch) that was returned in the response, if any.

### $res-\>status

The status of the response, which will match one of the following enumerations:

- •

  **URI::Fetch::URI\_OK()**

- •

  **URI::Fetch::URI\_MOVED\_PERMANENTLY()**

- •

  **URI::Fetch::URI\_GONE()**

- •

  **URI::Fetch::URI\_NOT\_MODIFIED()**

### $res-\>http\_status

The HTTP status code from the response.

### $res-\>http\_response

The *HTTP::Response* object returned from the fetch.

### $res-\>is\_success

### $res-\>is\_redirect

### $res-\>is\_error

Wrappers around the `"$res->response"` methods of the same name, for convenience.

**Note:** there is one difference from the behaviour of HTTP::Response. If you are using a cache and get a 304 response, but the data is retrieved from the cache, then `"is_success"` will return true, because `"res->content"` is usable.

### $res-\>content\_type

The Content-Type header from the response.

## AUTHOR & COPYRIGHT

Please see the *URI::Fetch* manpage for author, copyright, and license information.
