WebKit2.URISchemeResponse

g GObject.Object GObject.Object WebKit2.URISchemeResponse WebKit2.URISchemeResponse GObject.Object->WebKit2.URISchemeResponse

Subclasses:

None

Methods

Inherited:

GObject.Object (37)

Structs:

GObject.ObjectClass (5)

class

new (input_stream, stream_length)

set_content_type (content_type)

set_http_headers (headers)

set_status (status_code, reason_phrase)

Virtual Methods

Inherited:

GObject.Object (7)

Properties

Name

Type

Flags

Short Description

stream

Gio.InputStream

w/co

stream-length

int

w/co

Signals

Inherited:

GObject.Object (1)

Fields

Inherited:

GObject.Object (1)

Name

Type

Access

Description

parent

GObject.Object

r

Class Details

class WebKit2.URISchemeResponse(**kwargs)
Bases:

GObject.Object

Abstract:

No

Structure:

WebKit2.URISchemeResponseClass

Represents a URI scheme response.

If you register a particular URI scheme in a WebKit2.WebContext, using WebKit2.WebContext.register_uri_scheme(), you have to provide a WebKit2.URISchemeRequestCallback. After that, when a URI response is made with that particular scheme, your callback will be called. There you will be able to provide more response parameters when the methods and properties of a WebKit2.URISchemeRequest is not enough.

When you finished setting up your WebKit2.URISchemeResponse, call webkit_uri_request_finish_with_response() with it to return the response.

classmethod new(input_stream, stream_length)
Parameters:
Returns:

the newly created WebKit2.URISchemeResponse.

Return type:

WebKit2.URISchemeResponse

Create a new WebKit2.URISchemeResponse

New in version 2.36.

set_content_type(content_type)
Parameters:

content_type (str) – the content type of the stream

Sets the content type for the self

New in version 2.36.

set_http_headers(headers)
Parameters:

headers (Soup.MessageHeaders) – the HTTP headers to be set

Assign the provided Soup.MessageHeaders to the response.

headers need to be of the type Soup.MessageHeadersType.RESPONSE. Any existing headers will be overwritten.

New in version 2.36.

set_status(status_code, reason_phrase)
Parameters:
  • status_code (int) – the HTTP status code to be returned

  • reason_phrase (str or None) – a reason phrase

Sets the status code and reason phrase for the self.

If status_code is a known value and reason_phrase is None, the reason_phrase will be set automatically.

New in version 2.36.

Property Details

WebKit2.URISchemeResponse.props.stream
Name:

stream

Type:

Gio.InputStream

Default Value:

None

Flags:

WRITABLE, CONSTRUCT_ONLY

The input stream to read from.

New in version 2.36.

WebKit2.URISchemeResponse.props.stream_length
Name:

stream-length

Type:

int

Default Value:

-1

Flags:

WRITABLE, CONSTRUCT_ONLY

The input stream length in bytes, -1 for unknown length.

New in version 2.36.