Top | Description | Object Hierarchy | Properties | Signals |
struct WebKitWebResource; const gchar * webkit_web_resource_get_uri (WebKitWebResource *resource
); WebKitURIResponse * webkit_web_resource_get_response (WebKitWebResource *resource
); void webkit_web_resource_get_data (WebKitWebResource *resource
,GCancellable *cancellable
,GAsyncReadyCallback callback
,gpointer user_data
); guchar * webkit_web_resource_get_data_finish (WebKitWebResource *resource
,GAsyncResult *result
,gsize *length
,GError **error
);
"failed" :Run Last
"finished" :Run Last
"received-data" :Run Last
"sent-request" :Run Last
A WebKitWebResource encapsulates content for each resource at the end of a particular URI. For example, one WebKitWebResource 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
WebKitWebResource, using webkit_web_resource_get_uri()
and
webkit_web_resource_get_response()
, as well as the raw data, using
webkit_web_resource_get_data()
.
const gchar * webkit_web_resource_get_uri (WebKitWebResource *resource
);
Returns the current active URI of resource
. 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, "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, "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 resource
.
|
a WebKitWebResource |
Returns : |
the current active URI of resource
|
WebKitURIResponse * webkit_web_resource_get_response (WebKitWebResource *resource
);
Retrieves the WebKitURIResponse of the resource load operation.
This method returns NULL
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.
|
a WebKitWebResource |
Returns : |
the WebKitURIResponse, or NULL if
the response hasn't been received yet. [transfer none]
|
void webkit_web_resource_get_data (WebKitWebResource *resource
,GCancellable *cancellable
,GAsyncReadyCallback callback
,gpointer user_data
);
Asynchronously get the raw data for resource
.
When the operation is finished, callback
will be called. You can then call
webkit_web_resource_get_data_finish()
to get the result of the operation.
|
a WebKitWebResource |
|
a GCancellable or NULL to ignore. [allow-none]
|
|
a GAsyncReadyCallback to call when the request is satisfied. [scope async] |
|
the data to pass to callback function. [closure] |
guchar * webkit_web_resource_get_data_finish (WebKitWebResource *resource
,GAsyncResult *result
,gsize *length
,GError **error
);
Finish an asynchronous operation started with webkit_web_resource_get_data()
.
|
a WebKitWebResource |
|
a GAsyncResult |
|
return location for the length of the resource data. [out] |
|
return location for error or NULL to ignore |
Returns : |
a string with the data of resource , or NULL in case
of error. if length is not NULL , the size of the data will be assigned to it. [transfer full]
|
"response"
property"response" WebKitURIResponse* : Read
The WebKitURIResponse associated with this resource.
"uri"
property"uri" gchar* : Read
The current active URI of the WebKitWebResource.
See webkit_web_resource_get_uri()
for more details.
Default value: NULL
"failed"
signalvoid user_function (WebKitWebResource *resource,
gpointer error,
gpointer user_data) : Run Last
This signal is emitted when an error occurs during the resource load operation.
|
the WebKitWebResource |
|
the GError that was triggered |
|
user data set when the signal handler was connected. |
"finished"
signalvoid user_function (WebKitWebResource *resource,
gpointer user_data) : Run Last
This signal is emitted when the resource load finishes successfully or due to an error. In case of errors "failed" signal is emitted before this one.
|
the WebKitWebResource |
|
user data set when the signal handler was connected. |
"received-data"
signalvoid user_function (WebKitWebResource *resource,
guint64 data_length,
gpointer user_data) : Run Last
This signal is emitted after response is received, every time new data has been received. It's useful to know the progress of the resource load operation.
|
the WebKitWebResource |
|
the length of data received in bytes |
|
user data set when the signal handler was connected. |
"sent-request"
signalvoid user_function (WebKitWebResource *resource,
WebKitURIRequest *request,
WebKitURIResponse *redirected_response,
gpointer user_data) : Run Last
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.
|
the WebKitWebResource |
|
a WebKitURIRequest |
|
a WebKitURIResponse, or NULL
|
|
user data set when the signal handler was connected. |