Yes. I was on the right track. It was the POST vs. GET. the python
jsonrpc service requires the POST headers. Namely Content-Length and a
proper json formatted body.
FWIW, this worked (in that I got back a response). It failed
evalJSONDoc though, so I have to validate my output, but that's
another problem.
var searchterm = escape(getElement('searchTextField').value);
log('searchterm: ' + searchterm);
var postBody='"{params":["' + searchterm + '"],"method":"search","id":
1}';
log("Content-Length: " + postBody.length);
log(postBody);
var req = getXMLHttpRequest();
req.open('POST', '/services/search.py', true);
req.setRequestHeader('Host','saskblogstest.catprint.ca');
req.setRequestHeader('Content-type','application/json');
req.setRequestHeader('Content-Length',postBody.length);
var d_POST = sendXMLHttpRequest(req,postBody);
d_POST.addCallbacks(function(e){ log(e.response); });
Thank you to Bob and Boczek in the archives for your code snippets.
Cheers,
lance
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"MochiKit" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/mochikit?hl=en
-~----------~----~----~----~------~----~------~--~---