WebKit.URISchemeResponse

g GObject.Object GObject.Object WebKit.URISchemeResponse WebKit.URISchemeResponse GObject.Object->WebKit.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)

Class Details

class WebKit.URISchemeResponse(**kwargs)
Bases:

GObject.Object

Abstract:

No

Structure:

WebKit.URISchemeResponseClass

Represents a URI scheme response.

If you register a particular URI scheme in a WebKit.WebContext, using WebKit.WebContext.register_uri_scheme(), you have to provide a WebKit.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 WebKit.URISchemeRequest is not enough.

When you finished setting up your WebKit.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 WebKit.URISchemeResponse.

Return type:

WebKit.URISchemeResponse

Create a new WebKit.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

WebKit.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.

WebKit.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.