3 Soup = imports.gi.Soup;
5 var session = new Soup.SessionSync();
10 // Soup.URI is a struct.
11 var uri = new Soup.URI.c_new("http://www.roojs.com/admin.php");
12 var msg = new Soup.Message({method:"GET", uri:uri});
14 var auth = new Soup.Auth.c_new(Soup.AuthBasic.type, msg, "Basic realm=\"Test\"");
16 print(auth.authenticate);
17 auth.authenticate('aaaa','bbbb');
18 var authmsg = auth.get_authorization(msg);
20 msg.request_headers.append('Authorization', authmsg + '==')
22 //request.headers_append...
23 var status = session.send_message(msg);
24 // session.queue_message(function(ses, msg) {
30 //print(msg.response_body.data);