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 expected content length of the response.

props.http_headers: MessageHeaders

The HTTP headers of the response, or None if the response is not an HTTP response.

Added in version 2.6.

props.mime_type: str

The MIME type of the response.

props.status_code: int

The status code of the response as returned by the server.

props.suggested_filename: str

The suggested filename for the URI response.

props.uri: str

The URI for which the response was made.