I'm trying to get the client to send data to the server with this
MochiKit/Javascript function....

(I got latest SVN source for MochiKit that has doXHR.)

function send_data() {
        var d = doXHR("/chat/print_data",
                      {method : "POST",
                       sendContent : queryString({"apple" :
"orange"}),
                       });
        d.addCallback(success_handler);
        d.addErrback(failure_handler);
}

I'm trying to send it to the print_data method show below....

@turbogears.expose()
 def print_data(self, the_data):
         open("/output_file", "w").write(the_data)

Why do I get this error message about wanting more params?....

Traceback (most recent call last):
  File "/usr/lib/python2.5/site-packages/CherryPy-2.3.0-py2.5.egg/
cherrypy/_cphttptools.py", line 121, in _run
    self.main()
  File "/usr/lib/python2.5/site-packages/CherryPy-2.3.0-py2.5.egg/
cherrypy/_cphttptools.py", line 264, in main
    body = page_handler(*virtual_path, **self.params)
TypeError: print_data() takes at least 2 arguments (1 given)

2008-01-20 14:53:35,459 turbogears.access INFO  - - "POST /chat/
print_data HTTP/1.1" 500 791 "" "Mozilla/5.0 (X11; U; Linux i686; en-
US; rv:1.8.0.12) Gecko/20070731 Ubuntu/dapper-security Firefox/
1.5.0.12"

Thanks in advance,

Chris

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"TurboGears" 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/turbogears?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to