Re: libseed-list Working with seed and Soup



After further investigation - it appears that the page http://www.google.com.hk/ returns Big5 encoded data, and hence causes problems, it appears that getting data from other sites works perfectly fine.

Since I don't intend to test against Big5 normally I guess it's not a big issue for me....

Regards
Alan

Alan Knowles wrote:
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();

_______________________________________________
libseed-list mailing list
libseed-list gnome org
http://mail.gnome.org/mailman/listinfo/libseed-list



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]