tests/soup.js
[gitlive] / tests / soup.js
index d9baaa7..80a76dd 100644 (file)
@@ -27,8 +27,17 @@ netrc.split("\n").forEach(function(nl) {
 });
  
 // Soup.URI is a struct.
-var uri = new Soup.URI.c_new("http://www.roojs.com/admin.php/Roo/person");
-var msg = new Soup.Message({method:"GET", uri:uri});
+var uri = new Soup.URI.c_new("http://www.roojs.com/admin.php/Events");
+//var uri = new Soup.URI.c_new("http://www.roojs.com/head.php");
+
+var msg = new Soup.Message({method:"POST", uri:uri});
+//var msg = new Soup.Message({method:"GET", uri:uri});
+
+// post..
+buftxt =  "remarks=test";
+var buf = new Soup.Buffer.c_new(buftxt, buftxt.length);
+msg.request_body.append_buffer(buf);
+
 
 var auth = new Soup.Auth.c_new(Soup.AuthBasic.type, msg, "Basic realm=\"Test\"");
 print(auth);
@@ -36,8 +45,8 @@ print(auth.authenticate);
 var authvals = authdata['git.roojs.com'];
 auth.authenticate(authvals.login ,authvals.password);
 var authmsg = auth.get_authorization(msg);
-
-msg.request_headers.append('Authorization', authmsg + '==')
+print(authmsg);
+msg.request_headers.append('Authorization', authmsg)
 
 //request.headers_append...
 var status = session.send_message(msg);