[webkit-gtk] Getting an HTTP response message

Carlos Garcia Campos cgarcia at igalia.com
Mon Aug 13 11:02:34 PDT 2012

El mar, 14-08-2012 a las 01:40 +0800, Jay Bhaskar escribió:
> 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.

No, there's response property in WebKitWebResource, so that you can
connect to notify::response signal to be notified when the response has
been received for the resource.

> invalid instance type error from glib/gio occurs when there is unavailable signal name or signal name not registered with correct gtkwidget.
> Thanks
> jaybhaskar
> ________________________________
>  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
> http://lists.webkit.org/mailman/listinfo/webkit-gtk
> _______________________________________________ webkit-gtk mailing list webkit-gtk at lists.webkit.org http://lists.webkit.org/mailman/listinfo/webkit-gtk

Carlos Garcia Campos
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 198 bytes
Desc: This is a digitally signed message part
URL: <http://lists.webkit.org/pipermail/webkit-gtk/attachments/20120813/a1fa14d3/attachment-0001.sig>

More information about the webkit-gtk mailing list