WebKit2WebExtension.URIResponse

g GObject.Object GObject.Object WebKit2WebExtension.URIResponse WebKit2WebExtension.URIResponse GObject.Object->WebKit2WebExtension.URIResponse

Subclasses:

None

Methods

Inherited:

GObject.Object (37)

Structs:

GObject.ObjectClass (5)

get_content_length ()

get_http_headers ()

get_mime_type ()

get_status_code ()

get_suggested_filename ()

get_uri ()

Virtual Methods

Inherited:

GObject.Object (7)

Properties

Name

Type

Flags

Short Description

content-length

int

r

http-headers

Soup.MessageHeaders

r

mime-type

str

r

status-code

int

r

suggested-filename

str

r

uri

str

r

Signals

Inherited:

GObject.Object (1)

Fields

Inherited:

GObject.Object (1)

Name

Type

Access

Description

parent

GObject.Object

r

Class Details

class WebKit2WebExtension.URIResponse(**kwargs)
Bases:

GObject.Object

Abstract:

No

Structure:

WebKit2WebExtension.URIResponseClass

Represents an URI response.

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

get_content_length()
Returns:

the expected content length of self.

Return type:

int

Get the expected content length of the WebKit2WebExtension.URIResponse.

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

get_http_headers()
Returns:

a Soup.MessageHeaders with the HTTP headers of self or None if self is not an HTTP response.

Return type:

Soup.MessageHeaders

Get the HTTP headers of a WebKit2WebExtension.URIResponse as a Soup.MessageHeaders.

New in version 2.6.

get_mime_type()
Returns:

MIME type, as a string.

Return type:

str

Gets the MIME type of the response.

get_status_code()
Returns:

the status code of self

Return type:

int

Get the status code of the WebKit2WebExtension.URIResponse.

Get the status code of the WebKit2WebExtension.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()
Returns:

the suggested filename or None if the ‘Content-Disposition’ HTTP header is not present.

Return type:

str

Get the suggested filename for self.

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

get_uri()
Returns:

response URI, as a string.

Return type:

str

Gets the URI which resulted in the response.

Property Details

WebKit2WebExtension.URIResponse.props.content_length
Name:

content-length

Type:

int

Default Value:

0

Flags:

READABLE

The expected content length of the response.

WebKit2WebExtension.URIResponse.props.http_headers
Name:

http-headers

Type:

Soup.MessageHeaders

Default Value:

None

Flags:

READABLE

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

New in version 2.6.

WebKit2WebExtension.URIResponse.props.mime_type
Name:

mime-type

Type:

str

Default Value:

None

Flags:

READABLE

The MIME type of the response.

WebKit2WebExtension.URIResponse.props.status_code
Name:

status-code

Type:

int

Default Value:

0

Flags:

READABLE

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

WebKit2WebExtension.URIResponse.props.suggested_filename
Name:

suggested-filename

Type:

str

Default Value:

None

Flags:

READABLE

The suggested filename for the URI response.

WebKit2WebExtension.URIResponse.props.uri
Name:

uri

Type:

str

Default Value:

None

Flags:

READABLE

The URI for which the response was made.