WebKit.WebResource¶
- Subclasses:
None
Methods¶
- Inherited:
- Structs:
|
|
|
|
|
|
|
Virtual Methods¶
- Inherited:
Properties¶
Name |
Type |
Flags |
Short Description |
---|---|---|---|
r |
|||
r |
Signals¶
- Inherited:
Name |
Short Description |
---|---|
This signal is emitted when an error occurs during the resource load operation. |
|
This signal is emitted when a TLS error occurs during the resource load operation. |
|
This signal is emitted when the resource load finishes successfully or due to an error. |
|
This signal is emitted when request has been sent to the server. |
Fields¶
- Inherited:
Class Details¶
- class WebKit.WebResource(**kwargs)¶
- Bases:
- Abstract:
No
- Structure:
Represents a resource at the end of a URI.
A
WebKit.WebResource
encapsulates content for each resource at the end of a particular URI. For example, oneWebKit.WebResource
will be created for each separate image and stylesheet when a page is loaded.You can access the response and the URI for a given
WebKit.WebResource
, usingWebKit.WebResource.get_uri
() andWebKit.WebResource.get_response
(), as well as the raw data, usingWebKit.WebResource.get_data
().- get_data(cancellable, callback, *user_data)¶
- Parameters:
cancellable (
Gio.Cancellable
orNone
) – aGio.Cancellable
orNone
to ignorecallback (
Gio.AsyncReadyCallback
orNone
) – aGio.AsyncReadyCallback
to call when the request is satisfieduser_data (
object
orNone
) – the data to pass to callback function
Asynchronously get the raw data for self.
When the operation is finished, callback will be called. You can then call
WebKit.WebResource.get_data_finish
() to get the result of the operation.
- get_data_finish(result)¶
- Parameters:
result (
Gio.AsyncResult
) – aGio.AsyncResult
- Raises:
- Returns:
a string with the data of self, or
None
in case of error. if length is notNone
, the size of the data will be assigned to it.- Return type:
Finish an asynchronous operation started with
WebKit.WebResource.get_data
().
- get_response()¶
- Returns:
the
WebKit.URIResponse
, orNone
if the response hasn’t been received yet.- Return type:
Retrieves the
WebKit.URIResponse
of the resource load operation.This method returns
None
if called before the response is received from the server. You can connect to notify::response signal to be notified when the response is received.
- get_uri()¶
- Returns:
the current active URI of self
- Return type:
Returns the current active URI of self.
The active URI might change during a load operation:
When the resource load starts, the active URI is the requested URI
When the initial request is sent to the server,
WebKit.WebResource
::sent-request
signal is emitted without a redirected response, the active URI is the URI of the request sent to the server.In case of a server redirection,
WebKit.WebResource
::sent-request
signal is emitted again with a redirected response, the active URI is the URI the request was redirected to.When the response is received from the server, the active URI is the final one and it will not change again.
You can monitor the active URI by connecting to the notify::uri signal of self.
Signal Details¶
- WebKit.WebResource.signals.failed(web_resource, error)¶
- Signal Name:
failed
- Flags:
- Parameters:
web_resource (
WebKit.WebResource
) – The object which received the signalerror (
GLib.Error
) – theGLib.Error
that was triggered
This signal is emitted when an error occurs during the resource load operation.
- WebKit.WebResource.signals.failed_with_tls_errors(web_resource, certificate, errors)¶
- Signal Name:
failed-with-tls-errors
- Flags:
- Parameters:
web_resource (
WebKit.WebResource
) – The object which received the signalcertificate (
Gio.TlsCertificate
) – aGio.TlsCertificate
errors (
Gio.TlsCertificateFlags
) – aGio.TlsCertificateFlags
with the verification status of certificate
This signal is emitted when a TLS error occurs during the resource load operation.
New in version 2.8.
- WebKit.WebResource.signals.finished(web_resource)¶
- Signal Name:
finished
- Flags:
- Parameters:
web_resource (
WebKit.WebResource
) – The object which received the signal
This signal is emitted when the resource load finishes successfully or due to an error. In case of errors
WebKit.WebResource
::failed
signal is emitted before this one.
- WebKit.WebResource.signals.sent_request(web_resource, request, redirected_response)¶
- Signal Name:
sent-request
- Flags:
- Parameters:
web_resource (
WebKit.WebResource
) – The object which received the signalrequest (
WebKit.URIRequest
) – aWebKit.URIRequest
redirected_response (
WebKit.URIResponse
) – aWebKit.URIResponse
, orNone
This signal is emitted when request has been sent to the server. In case of a server redirection this signal is emitted again with the request argument containing the new request sent to the server due to the redirection and the redirected_response parameter containing the response received by the server for the initial request.
Property Details¶
- WebKit.WebResource.props.response¶
- Name:
response
- Type:
- Default Value:
- Flags:
The
WebKit.URIResponse
associated with this resource.
- WebKit.WebResource.props.uri¶
-
The current active URI of the
WebKit.WebResource
. SeeWebKit.WebResource.get_uri
() for more details.