[webkit-gtk] Getting an HTTP response message

Jay Bhaskar jay.bhaskar at yahoo.com
Mon Aug 13 10:40:27 PDT 2012

Hi ,

i have tested your query..
for webkit1 both resource-request-starting and resource-response-recieved  working with webkit nightly build. however these signal in webkit2
is defferent. in webkit2 resource-request-starting has been renames as" resource-load-started" however resource-response-recieved signal is yet
to be ported to webkit2.

invalid instance type error from glib/gio occurs when there is unavailable signal name or signal name not registered with correct gtkwidget.


 From: "charles at hailoo.com" <charles at hailoo.com>
To: webkit-gtk at lists.webkit.org 
Sent: Monday, 13 August 2012 9:13 PM
Subject: [webkit-gtk] Getting an HTTP response message
I've been trying for a while to figure out how to use the Webkit GTK API to get an HTTP response code for a particular page-load.

According to the documentation, there seem to be two relevant signals: "resource-request-starting" and "resource-response-received", both of which provide you with access to a SoupMessage object that contains the HTTP information.

So, I tried connecting a signal for "resource-request-starting":

g_signal_connect(web_view, "resource-request-starting", G_CALLBACK(resource_request_starting_callback), 0);

...and it works nicely. Within the callback function I can get access to the underlying SoupMessage object which gives me information about the HTTP request.

BUT... when I try to get the actual HTTP response, I run into trouble. I tried listening for the "resource-response-received" signal:

g_signal_connect(web_view, "resource-response-received", G_CALLBACK(resource_request_starting_callback), 0);

This causes GLib to emit a warning:

GLib-GObject-WARNING **: /build/buildd/glib2.0-2.30.0/./gobject/gsignal.c:2295: signal `resource-response-received' is invalid for instance `0x2b46c00'

Googling around for "resource-response-received", I find almost no information at all about this signal. The documentation seems to indicate it does what I want, but in practice it doesn't actually work.

So, I don't know if I'm going about this the wrong way. But in general, what is the best way to get an HTTP status code (like 200, 404, etc.) for a page load using Webkit GTK?

webkit-gtk mailing list
webkit-gtk at lists.webkit.org
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.webkit.org/pipermail/webkit-gtk/attachments/20120814/b7082775/attachment.html>

More information about the webkit-gtk mailing list