tests/soup.js
[gitlive] / tests / soup.js
1 #!/usr/bin/env seed
2
3 Soup = imports.gi.Soup;
4
5 var session = new Soup.SessionSync();
6
7
8
9
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});
13
14 var auth = new Soup.Auth.c_new(Soup.AuthBasic.type, msg, "Basic realm=\"Test\"");
15 print(auth);
16 print(auth.authenticate);
17 auth.authenticate('a','b');
18 print(auth.get_authorization(msg));
19
20 //request.headers_append...
21 var status = session.send_message(msg);
22 // session.queue_message(function(ses, msg) {
23 //
24 //}
25 //)
26 print(status);
27
28 //print(msg.response_body.data);