WebKit2.URISchemeRequest

g GObject.Object GObject.Object WebKit2.URISchemeRequest WebKit2.URISchemeRequest GObject.Object->WebKit2.URISchemeRequest

Subclasses:

None

Methods

Inherited:

GObject.Object (37)

Structs:

GObject.ObjectClass (5)

finish (stream, stream_length, content_type)

finish_error (error)

finish_with_response (response)

get_http_body ()

get_http_headers ()

get_http_method ()

get_path ()

get_scheme ()

get_uri ()

get_web_view ()

Virtual Methods

Inherited:

GObject.Object (7)

Properties

None

Signals

Inherited:

GObject.Object (1)

Fields

Inherited:

GObject.Object (1)

Name

Type

Access

Description

parent

GObject.Object

r

Class Details

class WebKit2.URISchemeRequest(**kwargs)
Bases:

GObject.Object

Abstract:

No

Structure:

WebKit2.URISchemeRequestClass

Represents a URI scheme request.

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 request is made with that particular scheme, your callback will be called. There you will be able to access properties such as the scheme, the URI and path, and the WebKit2.WebView that initiated the request, and also finish the request with WebKit2.URISchemeRequest.finish().

finish(stream, stream_length, content_type)
Parameters:
  • stream (Gio.InputStream) – a Gio.InputStream to read the contents of the request

  • stream_length (int) – the length of the stream or -1 if not known

  • content_type (str or None) – the content type of the stream or None if not known

Finish a WebKit2.URISchemeRequest by setting the contents of the request and its mime type.

finish_error(error)
Parameters:

error (GLib.Error) – a GLib.Error that will be passed to the WebKit2.WebView

Finish a WebKit2.URISchemeRequest with a GLib.Error.

New in version 2.2.

finish_with_response(response)
Parameters:

response (WebKit2.URISchemeResponse) – a WebKit2.URISchemeResponse

Finish a WebKit2.URISchemeRequest by returning a WebKit2.URISchemeResponse

New in version 2.36.

get_http_body()
Returns:

(nullable): the body of the self.

Return type:

Gio.InputStream

Get the request body.

New in version 2.40.

get_http_headers()
Returns:

the Soup.MessageHeaders of the self.

Return type:

Soup.MessageHeaders

Get the Soup.MessageHeaders of the request.

New in version 2.36.

get_http_method()
Returns:

the HTTP method of the self

Return type:

str

Get the HTTP method of the self.

New in version 2.36.

get_path()
Returns:

the URI path of self

Return type:

str

Get the URI path of self.

get_scheme()
Returns:

the URI scheme of self

Return type:

str

Get the URI scheme of self.

get_uri()
Returns:

the full URI of self

Return type:

str

Get the URI of self.

get_web_view()
Returns:

the WebKit2.WebView that initiated self.

Return type:

WebKit2.WebView

Get the WebKit2.WebView that initiated the request.