3 Soup = imports.gi.Soup;
4 Netrc = imports['../Netrc.js'].Netrc;
6 GLib = imports.gi.GLib;
8 var session = new Soup.SessionSync();
9 File = imports['../File.js'].File;
13 // Soup.URI is a struct.
14 var uri = new Soup.URI.c_new("http://www.roojs.com/admin.php/Roo/Events");
15 //var uri = new Soup.URI.c_new("http://www.roojs.com/head.php");
17 var msg = new Soup.Message({method:"POST", uri:uri});
18 //var msg = new Soup.Message({method:"GET", uri:uri});
21 buftxt = "remarks=test";
23 msg.set_request('application/x-www-form-urlencoded', Soup.MemoryUse.COPY, buftxt, buftxt.length)
26 var auth = new Soup.Auth.c_new(Soup.AuthBasic.type, msg, "Basic realm=\"Test\"");
28 print(auth.authenticate);
29 var authvals = authdata['git.roojs.com'];
30 auth.authenticate(authvals.login ,authvals.password);
31 var authmsg = auth.get_authorization(msg);
33 msg.request_headers.append('Authorization', authmsg)
35 //request.headers_append...
36 var status = session.send_message(msg);
37 // session.queue_message(function(ses, msg) {
43 print(msg.response_body.data);