URIResponse#

class URIResponse(**properties: Any)#

Superclasses: Object

Represents an URI response.

A URIResponse contains information such as the URI, the status code, the content length, the mime type, the HTTP status or the suggested filename.

Methods#

class URIResponse
get_content_length() int#

Get the expected content length of the URIResponse.

It can be 0 if the server provided an incorrect or missing Content-Length.

get_http_headers() MessageHeaders#

Get the HTTP headers of a URIResponse as a MessageHeaders.

Added in version 2.6.

get_mime_type() str#

Gets the MIME type of the response.

get_status_code() int#

Get the status code of the URIResponse.

Get the status code of the URIResponse as returned by the server. It will normally be a SoupKnownStatusCode, for example %SOUP_STATUS_OK, though the server can respond with any unsigned integer.

get_suggested_filename() str#

Get the suggested filename for response.

Get the suggested filename for response, as specified by the ‘Content-Disposition’ HTTP header, or None if it’s not present.

get_uri() str#

Gets the URI which resulted in the response.

Properties#

class URIResponse
props.content_length: int#

The type of the None singleton.

props.http_headers: MessageHeaders#

The type of the None singleton.

Added in version 2.6.

props.mime_type: str#

The type of the None singleton.

props.status_code: int#

The type of the None singleton.

props.suggested_filename: str#

The type of the None singleton.

props.uri: str#

The type of the None singleton.