libseed-list Working with seed and Soup
- From: Alan Knowles <alan akbkhome com>
- To: libseed-list gnome org
- Subject: libseed-list Working with seed and Soup
- Date: Wed, 20 Jan 2010 13:00:12 +0800
Has anyone managed to use Soup and get the response_body, I've had a
quick go doing this, however it has problems getting the data from the
MessageBody
(This is a debian package of seed/ libseed 2.28.0-2) so it should be
reasonably up-to-date
Or is there a better way to do simple XmlHttpRequest like calls?
Gtk = imports.gi.Gtk;
Soup = imports.gi.Soup;
var session = new Soup.SessionAsync();
// Soup.URI is a struct.
var uri = new Soup.URI.c_new("http://www.google.com.hk/");
var request = new Soup.Message({method:"GET", uri:uri});
var status = session.queue_message(request, function(ses,msg) {
Seed.print(msg.response_body.length); // prints 8062
Seed.print(msg.response_body.data); // prints empty string.
Seed.print(msg.status_code); // prints 200
// Seed.print(msg.request_body.data);
});
Gtk.init(0, null);
Gtk.main();
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]